Questions tagged [custom-post-type-archives]

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 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 ...
  • 1
0 votes
0 answers
187 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. ...
  • 1
0 votes
1 answer
18 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 ...
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), ...
  • 3
0 votes
1 answer
40 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 ...
0 votes
0 answers
41 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( ...
0 votes
0 answers
23 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 ...
  • 1
1 vote
1 answer
46 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
9 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) ...
  • 165
0 votes
1 answer
33 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 ...
  • 101
0 votes
0 answers
42 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
60 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
154 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
66 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
21 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
30 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
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' ), '...
0 votes
0 answers
20 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
64 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
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
33 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
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 ...
0 votes
1 answer
56 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
152 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
147 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
113 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
1 answer
260 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
64 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
135 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
63 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
875 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
154 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
76 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
136 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
121 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
302 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
69 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
53 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
255 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
120 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,665
2 votes
0 answers
71 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
199 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
40 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
265 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
117 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
233 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
101 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
36 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, ...

1
2 3 4 5
9