Articles of custom post type archives

Plain <a> links in single-class.php and archive-class.php not working

This seems like it should be super-easy to resolve, but it has me stumped. All the links on my page added via get_header() and get_footer() work just fine. The links added via single-class.php and archive-class.php don’t work. Looking at the source code in Google Chrome, the links appear to be perfectly formed, but when I […]

Query Posts that have Custom Taxonomy

I’m having trouble querying posts that have multiple tags from a custom taxonomy. For example, if I have a post called “Strawberry Splice,” it has the Meal Types (custom taxonomy) “Gluten Free” and “Beverages.” When I filter the posts to look for “Gluten Free,” “Strawberry Splice” shows up but when I search for “Beverages,” there […]

Using WP_Query how can I show events (a custom post type) that are in the future?

I am using a plugin called events manager. There is a custom post type called events, & each event has a date in a custom field. There is also a custom taxonomy called event categories. On my site, all the events that have been assigned to a term in the event categories taxonomy, have an […]

Custom Post Type Archive template not being called

My question is similar to a number of posts on this site, but I haven’t found a solution to my specific issue yet. I’m trying to implement an archive for a custom post type, “ttwi_course”. I completed the following steps, which I’ve successfully performed on numerous other sites: I registered the CPT, code below I […]

is_page() not working with archives?

I am creating a dynamic menu and in my foreach loop I am running a is_page using the page title: <li class=”<?= (is_page($tlp->post_title) ? ‘active’ : ”);?>”> </li> This works fine for pages that are actually created in the WP admin. But for other post types that rely on the archive it doesn’t work. So […]

Limiting the Archive page to posts posted by particular author

I am on Archive Page of a custom post type gallery. I have introduced custom permalink variable – author_id. Lets say i get the permalink variable in $perm_author_id. I want to compare $perm_author_id and get_the_author_meta(ID) and then display the posts if they are equal. How can I limit posts displayed on the archive page on […]

How to display archive page posts based on author_id

I would like the posts to be displayed on archive page of custom post – gallery based on author_id i.e. the author_id is passed as permalink variable. The posts displayed on archive page would be only those posts published by author whose author_id is passed. My custom post gallery archive page has the url http://localhost/?post_type=gallery […]

Custom Post Type with Configurable Sidebar via ACF

I am using a custom post type (CPT) trainings on one of my client’s sites. I’ve also added a CPT called sidebars, which can get linked into trainings or pages via the “relation” field type. To get an overview over all trainings, I’ve created a separate template “tpl-trainings.php” and added an “overview”-page, which in turn […]

archive-{$post_type}.php not loading. instead the default archive.php loads

My has-archive is set to true in the register_post_type. My archive-portfolio.php exists. I’ve tried flushing rewrite rules. I’ve tried a lot of other stuff, and after every step, I reset/saved/resaved/refreshed my permalink structure. This is my register_post_type register_post_type( ‘portfolio’, array( ‘labels’ => array( ‘name’ => __( ‘Portfolio Items’ ), ‘singular_name’ => __( ‘Portfolio Item’ ), […]

Url to archive page for custom post type

I made a custom post type , and an archive page for the post type. I don’t know if there is a url where I can access this archive page? I would like to have a page where all the “posts” (products) for this archive is listed. But they don’t need to be organized into […]