HTML in category name

Thanks all @ValentinGenev i choose this option, but i’m totally newbie so i Have to study WP much more in order to follow your lead. I found this in my theme (extras.php): if ( $child_theme_support == ‘default’ ) { $categories_list = get_the_category_list(esc_html__(‘, ‘, ‘blossom-fashion-pro’)); }else{ $categories_list = get_the_category_list(esc_html__(‘ ‘, ‘blossom-fashion-pro’)); } if ($categories_list) { echo … Read more

How can I change the output display of my pagination?

I could see that you are trying to achieve the following output: <div class=”pagination”> <span>Page {current} of {total pages}</span> {links here} </div> And you attempted it like so: ‘before_page_number’ => ‘<div class=”pagination”><span>Page ‘. // wrapped for clarity $paged .’ of ‘ . $term->max_num_pages . ‘</span></div>’ But that will actually add the markup before each and … Read more

Show the section only if custom taxonomy was chosen

You already check, if given post has any terms assigned. All you need to do is to move that check earlier in the code. <?php $terms = get_the_terms( get_the_ID(), ‘colour’ ); if ( $terms && ! is_wp_error( $terms ) ) : ?> <section class=”colour__chart”> <div class=”container”> <div id=”color-chart”> <h2>Colour Chart</h2> <hr class=”divider”> <?php foreach ( … Read more

How to display only the direct children of a term on a taxonomy page

You have got the current term id by the following code $current_term_id = get_queried_object_id(); Getting all the info of chilldren of the parent, not grandchildren $termchildren = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $current_term_id , ‘taxonomy’ => ‘Structure’ ); $subcats = get_categories($termchildren); // Display the children foreach ($subcats as … Read more

one post per term taxonomy

Yeah sure. <?php $included_post_ids =array(); $args = array( ‘post_type’ => ‘APP_POST_TYPE’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘coupon_category’, // Taxonomy ‘field’ => ‘slug’, ‘terms’ => $tax[0]->slug, // Your category slug ), ), ); $custom_posts = get_posts( $args ); if( !empty( $custom_posts ) ){ foreach ($custom_posts as $key => $postObj) … Read more

custom taxonomy terms archive page

It seems like Qaisar has answered your question with “have you flushed re-write rules?”. However, I would like to clarify that it is NOT essential to add a taxonomy.php unless for some reason you are querying specific posts on the archive.php that doesn’t include this taxonomy. The order of WordPress file execution can be seen … Read more

Different permissions for same type of post

The simplest way is to create two custom post types. One will be “news” and one will be “whats-new”. So for example, you could create a plugin in /wp-content/plugins/ called news-post-types.php. The code below will create special permissions that only apply to this post type: <?php /* Plugin Name: Post types and permissions for News … Read more