As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [custom-post-type-archives]

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

Polylang: Custom post type archive doesn't show in both languages

I am trying to create an archive page for a custom post type which is not translated. All posts in this post type need to be shown regardless of the language and the content doesn't need to be ...
asiboe's user avatar
  • 1
0 votes
0 answers
35 views

Can't add custom post type archive page to menu

I cannot add this custom post type archive page to any menu from the admin. Adding via the front end customizer works fine. Viewing the archive page on the front end also works fine. My custom post ...
Tommizzy's user avatar
0 votes
1 answer
40 views

Dynamic WordPress rewrite rules for multiple custom post types

I'm very new to WordPress development and would like some pointers if this is possible. So I have this rewrite rule for my custom sidebar in functions.php: add_action('init', 'cpt_rewrite'); function ...
yuki-chan's user avatar
0 votes
0 answers
21 views

WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query

I'm having one Custom post type I have added a Sticky Option to that Custom Post Type. When I choose the post as sticky means it's not working for me. I have tried the below code. Please don't add ...
Meivel's user avatar
  • 1
0 votes
1 answer
413 views

Add custom display condition to Elementor Theme Builder for custom taxonomy children, grandchildren, and great-grandchildren

I have a few templates built with Elementor Theme Builder. However, the option to display them on nested archives is quite limited. Here's my case I have a custom taxonomy (tags) called Locations. ...
mardag's user avatar
  • 1
0 votes
1 answer
27 views

Custom archive URL as a subfolder of the custom post type slug

I have a Custom Post Type called Whatever. The slug for this CPT is whatever. By default, I can access the posts archive in the frontend at /whatever and each post at /whatever/post-slug But I would ...
Álvaro Franz's user avatar
0 votes
1 answer
23 views

How to link to an archive-special.php from a custom front-page template?

It seems to me that I am trying to do something really simple : linking to a custom archive page. I'm almost ashamed that I'm struggling with this ! I already created the custom post type (books), ...
Gadget's user avatar
  • 3
0 votes
1 answer
45 views

Pagination not working only on Archive-Name.php using new WP_Query

I created an archive-sticky.php where I added the code below to show all sticky posts in one single page with pagination as there will be 100s of sticky posts in the coming days. Now, this code ...
Elaine Byene's user avatar
0 votes
0 answers
45 views

add_rewrite_rule pagination 404 error on page 4 and above

I am working on a site using Wordpress 6.0.2. Astra is the theme and I am using Elementor Pro. I have lots of custom post types and taxomonies. I am using add_rewrite_rule like this: add_rewrite_rule( ...
Steve Hoare's user avatar
0 votes
0 answers
24 views

Pagination not working on custom post type archive

The pagination is not working. In settings > reading I have set '3' posts for blog pages show at most. On my custom post type archive page, I have 9 posts showing and I have this code. Not sure ...
Carina's user avatar
  • 1
1 vote
1 answer
58 views

Custom Post Types using wrong template (index) instead of archive-{type}.php - previously worked as expected

I have several custom post types on a site where top-level nav items use archive-{post-type}.php templates of the post types. These have recently had a template problem and they now use the index.php ...
Mike's user avatar
  • 23
0 votes
0 answers
12 views

Best practice to display a list/archive of Custom Posts in a Page Template

I often need to have a Page, whose content is editable by an editor user in admin, displaying a list of Custom Posts. So I create a Page in the admin and create a Page Template (ex : page-my_cpt.php) ...
Max's user avatar
  • 165
0 votes
1 answer
37 views

Show custom post type on post category page doesn't work / breaks navigation

I'm making some changes to a site created by someone else. I don't work with WP often so I'm not too familiar with all the hooks, etc. On this site they have normal posts and a custom post type called ...
Mosh's user avatar
  • 101
0 votes
0 answers
65 views

Is possible register two archive pages for single custom post type?

I have a custom post type registered with register_post_type( 'courses', $args ); (like documentation), and I use template archive-courses.php for page www.example.com/courses. I'm using this archive ...
rafaelfndev's user avatar
0 votes
1 answer
100 views

On archive.php show loop for child categories if they exist or posts if they don't, on custom post type

I have a custom post type 'sch_keynote', with custom taxonomy 'sch_keynotegroups'. On the archive page I have managed to create two loops, one for child categories and one for posts. I only want to ...
Ruth's user avatar
  • 11
0 votes
1 answer
207 views

WP_Query - How to get all posts of specific days of week by custom field date?

I have a filter on frontend with days of weeks, and I need show only posts that are published on especific day (or days). The date are on custom field day_of_event (the filter is based on this field, ...
rafaelfndev's user avatar
0 votes
1 answer
88 views

Array_search ignoring the first element [closed]

I made (copy) a function to make the url of the custom post (named investigacion) by year. function tex_get_archives($post_type = 'investigacion') { global $wpdb; $query2 = "...
Daniel Leandro's user avatar
0 votes
0 answers
13 views

Custom post archive page not opening 404 page

I have custom post type like this register_post_type( 'workforce_archive', array( 'labels' => array( 'name' => __( 'Workforce Archives' ), '...
Avijit Palit's user avatar
0 votes
0 answers
14 views

Archive page of CPT's custom Taxonomy

I have a Custom Post Type: "Sponsors" Sponsors have a Custom Taxonomy: "Sponsor Ranks" Sponsor Ranks are divided like Platinum Sponsors - Gold Sponsors - Silver Sponsors and so on ...
David Weermeijer's user avatar
0 votes
0 answers
35 views

How can I combine Wordpress default Tags and bbPress tags into one archive page?

I'm trying to figure out how to combine two taxonomies? I've got three things going on: Tags from Buddyboss's Forums (Buddypress/bbpress) Tags from The Events Calendar Pro Tags from Wordpress's ...
Alex Abell's user avatar
0 votes
2 answers
28 views

Getting Same Description in All the Custom Taxonomy Posts

I have developed a custom taxonomy post type. I have displayed categories & inside categories posts/(products). I am getting the Post title & Image as they should be (which I add), but the ...
Hasnain Ghias's user avatar
0 votes
1 answer
60 views

Archive page for Wordpress Custom Post Type doesn't show pagination from paginate_links()

I have a custom post type with courses-events as the slug. In functions.php, I have: add_action( 'pre_get_posts', 'custom_archive_items' ); function custom_archive_items( $query ) { if ($query->...
arrr_matey's user avatar
0 votes
1 answer
182 views

Detect Ajax call inside pre_get_posts function

In the front end, I have a custom post type archive page with an AJAX Load More button. The loop of the archive page is ordered by date and ASC. I use the same args for the AJAX loop inside a ...
Mathieu Préaud's user avatar
0 votes
1 answer
182 views

2 Custom Post Types In 1 Archive Page?

I have 2 custom post types (announcements and news) and I want to have their own archive pages (which I have, and they're working) and an archive page that shows both posts types ordered by date. How ...
bwoogie's user avatar
  • 131
0 votes
1 answer
116 views

Main query disturb pre_get_post by category query

I've an archive page with custom post sorted by a custom field. I have two buttons that apply a filter by custom category. The result is not as desired. The correct number of results comes out, but ...
Joan Chaparro's user avatar
0 votes
1 answer
298 views

Polylang : Display term archive even if no posts

I use ACF to customize taxonomy term archives pages which are in fact Team member pages. Pages are translated with the help of Polylang. Problem is : If the member has no related posts, I can access ...
Guillaume Gautier's user avatar
1 vote
0 answers
22 views

Get number of post who belongs in two taxonomies!

I need a way to figure this in the image! I have two taxonomies (Band, City) in my custom post type and I need in my custom archive page to have all the posts who belong in each taxonomy! Is there a ...
Tsourou Nas's user avatar
0 votes
1 answer
71 views

What's the name of the custom post type yearly archive template?

I know there's a name for every kind of template. archive-CPT.php, or single-CPT even taxonomies taxonomy-taxonomyname.php but, what's the name I should use for the template that have my yearly ...
Daniel Leandro's user avatar
0 votes
1 answer
144 views

Create an array with all the links of the years' archive (of a custom post type)

I have a custom post type called "papers" and I need to create an array with all the archive links per year that exists. Something like: array ( [0]=> 'http://www.example.com/2021/?...
Daniel Leandro's user avatar
0 votes
1 answer
64 views

Custom Permalinks For CPT and pages with parent. Advanced Wordpress

So, I've created a CPT - Community Post: https://pastebin.com/9XSrvZAr For this CPT I've created two custom taxonomies: https://pastebin.com/fNhfpiM6 community_post_domain community_post_type My goal ...
Nadav's user avatar
  • 101
1 vote
1 answer
1k views

Custom post type: Disable single page, but keep archive

I am looking for the best way to create custom post-types which are only used as an archive for their posts. As an example I want an archive showing all employees of a company, but I don't want the ...
ProxxiM's user avatar
  • 11
1 vote
0 answers
180 views

WordPress post_where & posts_join not working only for custom post type

I have a custom WordPress plugin built for booking courses etc. My custom plugin has some new tables in which custom data like slot date, time etc are stored. I am trying to modify archive query for ...
Zeeshan Khan's user avatar
0 votes
1 answer
78 views

How to integrate single and archive templates for custom post type in any Wordpress theme

I am working on my new WP Plugin for advanced control of custom post types and meta boxes. Actually, I am working on an HTML Builder for the full customization of single and archive templates for the ...
Mauro's user avatar
  • 83
0 votes
1 answer
145 views

Why isn't the 'no results' being shown when a query returns no results?

I've been following this tutorial for a simple AJAX filter search within wordpress: https://itsmereal.com/simple-ajax-filter-search-for-wordpress/?unapproved=3915&moderation-hash=...
Eland's user avatar
  • 11
0 votes
1 answer
126 views

Permalink problems with custom post type and custom taxonomy

Question 1 Permalink structure I trying to implement the right url/permalink structure for my site, but I can't get it to work. I have the following setup: Custom post type: training ...
thegirlinthecafe's user avatar
1 vote
1 answer
390 views

How do I exclude posts from custom taxonomy from a custom post type archive?

I am trying to exclude posts from a custom taxonomy from displaying on a specific custom post type archive. How can I accomplish that? Today, I do this on a per post basis which is not practical. ...
Brandon's user avatar
  • 13
1 vote
1 answer
119 views

Custom Taxonomy template is not recognised

I have created a custom post type (products), and at the moment I have 2 custom taxonomies (lips and eyes). I can get the archive to show up for 'products', and I can get to the URL for the archive ...
Siobhan M's user avatar
0 votes
1 answer
55 views

Add archive/category results to single post page

Have posts, want related categories to display under them. Post example: Artist name. Category example: posts with the Artist name. My current version, arrived at based on a comment from @birgire, ...
markw's user avatar
  • 17
0 votes
1 answer
293 views

Different number posts per page based on custom post type term id

Trying to cobble together a function from various suggestions that sets the number of posts per page based on the custom post type category in question. For instance, an "Alphabetical" ...
markw's user avatar
  • 17
0 votes
1 answer
149 views

sort CPT on Custom Taxonomy Archive page

I have created a custom post type called "al_product" and attached to it a custom taxonomy called "product_category". In my archive-product_category.php I have this (relevant) code:...
rudtek's user avatar
  • 5,760
2 votes
0 answers
79 views

How do I get WordPress URL rewrites into Sitemap?

Consider the two following custom post types: Museums Bakeries With one shared taxonomy: Region I'm using rewrite rules to improve the URL structure, so I can serve pages to visitors such as: ...
rc_tn's user avatar
  • 21
0 votes
0 answers
225 views

Add content in cpt archive page

I am trying to add some custom content hooked into custom post type archive page but I can't. I have already achieved it in single page with: add_filter( 'the_content', 'yourprefix_add_to_content' ); ...
Bariock's user avatar
1 vote
0 answers
41 views

Custom Post Type Yearly Archive Permalinks

I'm struggling a bit with the permalinks on yearly archives for a custom post type. I'm using wp_get_archives to get a list of the yearly archives but the url for these comes out as follows: http://...
Burgi's user avatar
  • 363
0 votes
0 answers
23 views

Does this archive template part look like its making too many calls to the db?

I set up a custom post type & taxonomy and registered it as a plugin. Then i'm referencing it from an archive template like this: <?php /* This loop is used in the Archive [.php] template. */ ...
Andy's user avatar
  • 215
1 vote
0 answers
284 views

How to get all product attributes for filters in WooCommerce?

I am trying to figure out how WooCommerce decides which product attribute filters to bring. Because it does not only bring filterable attributes of the products in first page of an archive, but also ...
km onur's user avatar
  • 109
0 votes
2 answers
143 views

How to add specific terms in a custom post type?

I am creating a dedicated WordPress ecommerce website without using WooCommerce for myself. I created the custom post type called 'products' but now I am stuck on how to add specific terms like SKU, ...
Rishabh Jha's user avatar
1 vote
0 answers
253 views

CPT UI - elementor tags archive template not working

I've faced a situation with CPT UI and Elementor. I've created a CPT with categories and tags. But, when I tried to create a template for those tags (to dynamically redirect to my CPT posts associated ...
Kevin Chauvet's user avatar
0 votes
1 answer
164 views

How to change URL for custom post type archive?

I'm trying to change the URL for my custom post type archive. At the moment, the archive of my post type has the URL https://example.com/myposttype/ I want to change that to https://example.com/xyz/...
TheKidsWantDjent's user avatar
0 votes
1 answer
37 views

Finding the CPT archive template source

I've created a CPT named kindergarten by a plugin ; I was able to see the archive page of this custom post type with its posts; When I was using Elementor for changing the template of this post type, ...
Sarah Jason's user avatar
0 votes
0 answers
33 views

Displaying all posts by category and showing content on click

I am building a WordPress site for a composer who has written over 200 pieces of music. Each is a custom post (work), organised by a hierarchical custom taxonomy/category (type – being orchestral, ...
mtm's user avatar
  • 39

1
2 3 4 5
9