Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy

I need help with WP custom taxonomy and custom post types. I never find a working solution so far. Please accept my apologies if this has a simple solution. I tried my best to find solution everywhere first. Explanation of issue – I have one taxonomy called “department”. I have 3 CPT called “course”, “faculty”, … Read more

How to make an archive page displaying posts in a date range

I’m trying to make a couple of Page Templates for different Pages that should act as an archive to display posts (a Custom Post Type actually) in a certain date range. The website it concerns is http://memstories.com and the CPT is “Events”. I already found some mentions of a thread on WP Support (https://wordpress.org/support/topic/show-the-posts-published-before-a-specific-date?replies=2#post-1066144), but … Read more

How to create archive page for taxonomy terms within custom post type

I am needing to create an archive page custom taxonomy terms that are within a custom post type. It’s set up as CPT > Custom Taxonomy > Taxonomy Terms. I have a custom post type called “Projects,” and when creating the post, the user is to select a type of project for the listing (i.e. … Read more

Adding custom post types to archive.php

I have 3 different post types in my blog. When I click on a category of a custom post, I redirect to a 404 page, because by default archive.php does not recognize custom post types. I have found this solution (and other ones using same approach) on several different places: add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { … Read more

“Sticky” posts for each category (archive.php)

I need to have the ability to have Sticky posts for each category. The simplest way to do this appeared to be to just create two loops on the page. This is what I wrote: <?php //Custom “sticky” loop $sticky_posts = new WP_Query(array( ‘post__in’ => get_option(‘sticky_posts’) )); if ($sticky_posts->have_posts()) : while ($sticky_posts->have_posts()) : $sticky_posts->the_post(); get_template_part(‘post-formats/content’, … Read more

Post type archive page not working

I registered a custom post type using Custom Post Type UI, and created an archive page and named it archive-recipe.php, ‘recipe’ is my custom post type name. But its not working, instead its using the default archive.php. I set the has-archive to true but still not working. How to fix that? Here’s the code: register_post_type( … Read more

Custom Post Type archive giving 404

I am using WAMP with the latest version of WordPress installed. I have a custom post type created using the following… function register_fruit() { register_post_type(‘fruit’, array( ‘labels’ => array( ‘name’ => __( ‘Fruit’ ), ), ‘public’ => true, ‘has_archive’ => true, ‘capability_type’ => ‘post’, ‘rewrite’ => array(“slug” => “/fruit”, “with_front” => false), ‘supports’ => array( … Read more

Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar

I have 8 custom post types (which are actually for 8 different blogs and used as “blog landing pages”). Each custom post type is also a Blog Category and each has several sub categories to it. For example, there is a custom post type (“blog”) named Business without Borders. Within it are several subcategories such … Read more