How can I make front page to display custom taxonomy page?

I agree with @KrzysiekDróżdż While you should probably be able to do this it might be unnecessary work. However, this works with I test it, just change the category/term name and the template name (the part in get_template_part), and maybe the is_main_query() && $qry->is_home() conditional if you need to: function pregp_home_cat_wpse_104619($qry) { if (is_main_query() && … Read more

Echo custom taxonomy slug

Here’s the correct syntax for what you’re trying to do, if there’s just the single value for the ‘series’ custom taxonomy slug that you’re trying to retrieve. You were passing the whole array to your echoed string. I made a new variable $series which pulls the first/only value in the $terms_slugs array. And simplified a … Read more

Get all attachments by custom taxonomy – term

To get all images from the same term you can use WP_Query with the “tax_query” argument: $args = array( ‘post_status’ => ‘inherit’, ‘posts_per_page’ => -1, ‘post_type’ => ‘attachment’, ); $args[‘tax_query’] = array( array( ‘taxonomy’ => ‘YOUR_CUSTOM_TAXONOMY’, ‘terms’ => array( ‘YOUR_CUSTOM_TAXONOMY_TERM’ ), ‘field’ => ‘slug’, ), ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() … Read more

Exclude taxonomy term from all loops, but having it on widget

Looks like you’ve excluded a taxonomy term, not the whole taxonomy. Is that what you intended? But on to the answer… Right before your query in the widget add: remove_action( ‘pre_get_posts’, ‘exclude_category_posts’ ); And then you probably want to put it back again after that query by repeating: add_action( ‘pre_get_posts’, ‘exclude_category_posts’ ); That is a … Read more

WordPress set taxonomy on post?

wp_set_post_terms() requires you to provide term id not the term name or slug when it is a hierarchical taxonomy. From the codex: For hierarchical terms (such as categories), you must always pass the id rather than the term name to avoid confusion where there may be another child with the same name. Try the code … Read more