Hide a category/posts from the homepage in wp

Have you tried Ultimate Category Excluder plugin? You can use it to exclude categories very easily. You just need to select the categories that you want to remove. It can be very useful, as you are not comfortable with coding. Also, you can try using the following codes: function exclude_category_home( $query ) {if ( $query->is_home … Read more

Custom Archive Template for Multiple Categories

The simplest way I can think of would be to have the two categories you want to display together grouped under a parent category. Parent Category |—-Child Category A |—-Child Category B The file category-parent-category.php would by default show posts from both. The file category-child-category-a.php would only show from a. The file category-child-category-b.php would only … Read more

Custom get_the_password_form

If you look at the source code of the get_the_content() function which retrieves the post content, you’d see the following conditional: if ( post_password_required( $post ) ) return get_the_password_form( $post ); And in the get_the_password_form() function, there’s a filter you can use to customize the HTML of the default password form: return apply_filters( ‘the_password_form’, $output … Read more

Redirect category archives to pages

TL;DR: no contradiction, no error, no “sin” against the integrity. WordPress is flexible enough that you may decide to use what is best for use case. Wanna get rid of a taxonomy or all taxonomies? Go for it. In fact, i think this is kinda one the use cases for a headless WordPress.

How can I display categories on different pages

woocommerce is off topic here. But following code should get all product categories ( sub categories as well ). Just place it in the template ( where you want categories to appear in ) <?php $taxonomy = ‘product_cat’; $hierarchical = 1; $title=””; $empty = 0; $args = array( ‘taxonomy’ => $taxonomy, ‘hierarchical’ => $hierarchical, ‘title_li’ … Read more