WPcustoms WordPress Snippets

Copy the code and paste it in your theme's functions.php file. It can be found in your theme's folder.
You can then run the function by simply typing echo the_functions_name(); wrapped in php brackets.

We take no responsibility that this code is working on your site.
However we do our best to provide tested and optimized snippets.

Ignore sticky posts from the main query

We use the pre_get_posts filter to modify the main query and set it to ignore sticky posts. Keep in mind that they won’t show up anywhere. You manually need to run a custom query calling only sticky posts above the main loop if you want to show them at the top.