Questions tagged [custom-post-type-archives]

Filter by
Sorted by
Tagged with
1 vote
1 answer
35 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 ...
  • 23
0 votes
0 answers
8 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) ...
  • 135
0 votes
1 answer
29 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 ...
0 votes
0 answers
34 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 ...
0 votes
1 answer
36 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 ...
  • 11
0 votes
1 answer
45 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, ...
0 votes
1 answer
25 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 = "...
0 votes
0 answers
18 views

CPT archive with WP native/core tax/categories

So for some reason this is oddly difficult. I need to have a CPT which uses the core categories between the CPT reviews and core posts as news. I've tried getting the CPT archives as just URL which is ...
  • 67
0 votes
0 answers
22 views

How to set a 'page' as parent of a custom post type?

For various reasons, I would like to use a 'page' in preference to an archive page for one of our custom post types and have this be reflected in the permalink structure. I am struggling to find out ...
0 votes
0 answers
11 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' ), '...
0 votes
0 answers
17 views

is there a way of getting term children that only shows those from two taxonomies

hi so I am trying to list the terms ( product categories ) but only those that exist in another custom taxonomy, say 'workplaces'. I have the below code that does this, but without taking into account ...
  • 16
0 votes
0 answers
17 views

wp-query and wp_get_post_terms on custom taxonomy archive page

hi so I am just wondering how I can increment the pagination of a page based upon the terms found with wp_get_post_terms() rather than the post count for the page. this is the process i have: custom ...
  • 16
0 votes
0 answers
8 views

Display All Courses in Course Archive Page

I am Developing Course Management Website. I have main post type Course, under Course I have different taxonomies like Institution, Location, Course Type and etc.. The problem is, if one Course ...
0 votes
0 answers
13 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 ...
0 votes
0 answers
20 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 ...
0 votes
2 answers
26 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 ...
0 votes
0 answers
30 views

Invalid content when I try to import custom post type from the old template wordpress

I changed my wordpress theme on December 2021, and Im still trying to import the custom post types of my old theme to my new one.Ive tried like 5 times, the only thing that is importing is the ...
0 votes
1 answer
51 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->...
0 votes
1 answer
77 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 ...
0 votes
1 answer
34 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 ...
  • 131
0 votes
1 answer
89 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 ...
0 votes
0 answers
20 views

Custom post type archive URLs with a single taxonomy

I have two custom post types: Products Reviews These post types, share a single taxonomy: Category I want to make sure that the archive URLs become something like this: /reviews/category/term /...
  • 1
0 votes
1 answer
118 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 ...
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 ...
0 votes
1 answer
51 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 ...
0 votes
1 answer
91 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/?...
0 votes
1 answer
60 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 ...
  • 101
1 vote
1 answer
424 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 ...
  • 11
1 vote
0 answers
102 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 ...
0 votes
1 answer
65 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 ...
  • 83
0 votes
1 answer
116 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=...
  • 11
0 votes
1 answer
93 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 ...
1 vote
1 answer
180 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. ...
  • 13
1 vote
1 answer
46 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 ...
0 votes
1 answer
49 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, ...
  • 17
0 votes
1 answer
126 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" ...
  • 17
0 votes
1 answer
59 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:...
  • 5,467
2 votes
0 answers
62 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: ...
  • 21
0 votes
0 answers
141 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' ); ...
1 vote
0 answers
39 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://...
  • 363
0 votes
0 answers
22 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. */ ...
  • 215
1 vote
0 answers
218 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 ...
  • 109
0 votes
2 answers
60 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, ...
1 vote
0 answers
176 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 ...
0 votes
1 answer
46 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/...
0 votes
1 answer
35 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, ...
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, ...
  • 29
0 votes
0 answers
56 views

Archive Meta on Product Post Type

I am using a filtered search to provide end user the ability to browse either live/published Woocommerce product listings or archived product listings; however, I am running into an issue where I am ...
  • 1
0 votes
1 answer
40 views

Redirect logged in users from a custom post type archive page if they don't have a specific role

I have a Custom Post Type named flashcard and post of that type are listed by an archive-flashcard.php template. The bellow function force flashcard posts to be listed only for posts authors (they ...
  • 1,101
1 vote
0 answers
204 views

Use Custom Post Type archive page for the taxonomies term archive page

In my wordpress theme I created a new custom post type 'books' with 2 taxonomies ('series', 'genres'). when I visit the archive of the cpt 'books' (site.com/books), I list all the books. I added a ...
  • 11

1
2 3 4 5
9