Change Number of Posts Displaying on a Custom Post Type (CPT) Archive Page

To change the number of posts that appear in an archive page for a custom post type you can change the number using the pre_get_posts action with some passed in parameters.Normally the number of posts displayed per page is defaulted…
Completely hide WooCommerce products from shop, product search and WordPress search

You can hide a WooCommerce product from the shop page and product search by choosing ‘Hidden’ in the ‘Catalog visibility’ options from the Publish metabox on a product page in the backend. This is good and it hides the product…
Change Amount of WooCommerce Products Displayed on Shop Page

WooCommerce displays by default 4 columns and 10 products per page in the shop or archive page – the products per page is based off the amount of post set to display in the WP Admin Dashboard > Reading – Blog…
Filtering Posts with Custom Fields Using meta_query

You can further refine a list of posts by filtering any custom fields that the post has for a certain set of conditions, this is possible with WP_Meta_Query, which allows you to target custom fields as known as post meta. There…
Hide a certain Category’s Posts from the Home/Blog page in WordPress

To hide a certain Category’s posts from the home or blog page you just need to know the category ID and then use a filter on the pre_get_posts hook to exclude those posts. To find the ID for the Category just go…
Hide Pages from Search Results in WordPress

In WordPress by default both posts and pages are included in the Search Results, you can remove pages or posts for that matter and also include custom post types by using the action hook pre_get_posts. In your functions.php add the appropriate…
Show Custom Post Types in Category Archive Page

By default WordPress custom post types do not appear in a category or tag archive page, to change this behaviour and display the custom post type you can add this filter/function to your themes functions.php file. function themeprefix_show_cpt_archives( $query ) { if(…