how do I add a button in each category to display all posts?
how do I add a button in each category to display all posts?
how do I add a button in each category to display all posts?
I just found it out! By using get_query_var ( ‘cat’ ) you get the value of the category in the query. So you can use cat_is_ancestor_of ( parent-cat-id, get_query_var ( ‘cat’ ) ) which will return true if you are looking at a child of a specific parent category. And from there you can modify … Read more
Isotope Filtering with Bootstrap Tabs – Custom Post Type Query Loop in each Tab (Have to click twice to filter)
When you use pretty permalinks, WordPress creates a set of rules for each type of content. These rules define a pattern that each type of content’s URL’s will follow. When you have an incoming request, WordPress decides what is being requested by matching the URL with these rules. If multiple rules match, the one with … Read more
From Codex: taxonomy-{taxonomy}-{term}.php – If the taxonomy were sometax, and taxonomy’s slug were someterm WordPress would look for taxonomy-sometax-someterm.php. In the case of Post Formats, the taxonomy is ‘post_format’ and the terms are ‘post-format-{format}. i.e. taxonomy-post_format-post-format-link.php taxonomy-{taxonomy}.php – If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php There is no custom post type custom … Read more
Taxonomy archive index pages for custom taxonomies are not rendered using archive-{taxonomy}.php, but rather, using taxonomy-{taxonomy}-{term}.php, which falls back to taxonomy-{taxonomy}.php, which falls back to taxonomy.php. Refer to the Template Hierarchy. WordPress interprets archive-{foobar}.php as archive-{post-type}.php, and would use that template to render the archive index for the foobar post-type. So, your artist taxonomy archive … Read more
As per the OP’s answer that was added in their question, I’ve separated it instead. In short: …deactivating and reactivating plugins, commenting and uncommenting, I now have my site working as intended. Here’s the elaboration given by the OP as well: I have a couple of custom post types in my functions.php file. Each one … Read more
I have seen the magic “.” break a lot of sites paginations and do errors to such issues as yours (return status 404 for subcategories). Try installing a plugin named “WP No category base” (link below) and remove that dot from the category base. Save permalinks a few times after installing plugin and hope that … Read more
You corrected the filter hook name from archive-videos to template_include, but in the first function return $query; statement comes before add_filter(), so the filter is not added. add_action( ‘pre_get_posts’ ,’post_type_videos’ ); function post_type_videos( $query ) { if ( ! is_admin() && $query->is_post_type_archive( ‘videos_cpt’ ) && $query->is_main_query() ) { $query->set( ‘post_type’, ‘videos’ ); //set query arg … Read more
In function.php add_action(‘pre_get_posts’,’show_all_people’); function show_all_people( $query ) { if ( $query->is_main_query() && is_post_type_archive(‘people’) ) { $query->set(‘posts_per_page’, -1); } } See Codex docs for pre_get_posts hook