Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

Have page with grid view and stylize certain posts differently

I wish to have a gridview displaying posts that when a post is of a custom post type displays differently from the others. I've seen many of the grid view plugins, but none of them seemed to advertise ...
0
votes
1answer
12 views

Route subpage to Custom Post Type

I have an artists-single.php page template which shows when I navigate to: /artists/djave_co Is there a way to route /artists/djave_co/anything to the same artists-single.php page? Then I can use ...
0
votes
0answers
13 views

archiv for custom post type

I have a date archiv for a custom post type. It's working as I want it to. But I would like to structure the links differently. Now it's looking like this: April 2021 April 2020 January 2020 ...
1
vote
1answer
25 views

Trouble with CPT Child 404

I'm having issues with some custom post types showing up as 404's. I have a website i've been running for about five years, that has a CPT called Videos, and a single PAGE which acts as the Videos ...
0
votes
1answer
15 views

Custom post type for text box that appears on every page

I want to create a custom post type for an entry that will appear on every page of a website. A few other CMS's have a 'globals' entry type for this. How would I go about this using Wordpress?
0
votes
0answers
16 views

create a “add icon” field in taxonomies page

Similar to this post but not quite, I have a Wordpress theme with free Fontawesome already installed and I wish to add a field in the "create Categories" box where I could type in and choose an icon ...
0
votes
0answers
23 views

Custom Post Type Pagination getting 404 error

function viewevnts() { ob_start(); $query = ( get_query_var( 'query' ) ) ? get_query_var( 'query' ) : 1; $args = array( 'post_type' => 'events', 'category_name' => 'en-events'...
1
vote
2answers
44 views

How to target a specific custom post type post and its all children and grandchildren?

I will really appreciate your help to create a function that will check by a given $my_custom_post_type_name and $post_name and return true if the current page / post is a $post_name or $...
0
votes
1answer
38 views

Custom REST endpoint not working to retrieve single posts (“rest_no_route”)

I've got the following basic route for my custom REST endpoint: add_action('rest_api_init', 'my_cpt_route'); function my_cpt_route() { register_rest_route('mytheme/v1/', 'my_cpt', array( '...
0
votes
0answers
8 views

Alter $post object

I'm helping someone who has a WordPress website that's completely set up with all kinds of plugins. Some not doing exactly standard stuff or going through the proper hooks/filters. One of these ...
0
votes
1answer
10 views

How to search through all child taxonomies using WP_Query?

I need to create a page in which I can search through child taxonomies(custom child-category) based on GET request (For example $_GET['search_cat']) using WP_QUERY. I just want to list all of the sub-...
0
votes
0answers
10 views

Category custom post type admin dashboard

I use the plugin to create custom entries and the taxonomy of CPT UI and use Categories (WP Core) for the category, but when I open the entries, I don’t have a category list on the side where I can ...
0
votes
0answers
23 views

WP Slug Customization gives Error 404 / Not found (PODs Custom Post Types)

I am using PODs custom post type and I have created bi-relatation between two post types. My idea is to get a custom slug when there is a relation between two custom post types like: /custom-post-...
0
votes
0answers
11 views

Update main post with same category when creating custom post to update the modified date

I have 2 post type, so i create post on my main post type, then i need to create another post to fill the content to my main post in custom post type. Is there any way to update my main post publish ...
0
votes
1answer
36 views

How do I add html content to custom post type Posts using php?

I'm trying to do something that I'm sure is very basic, but I can not figure out how to do it. Here's the setup: I used the CPT UI plugin to create a custom post type called board_docs, and I used the ...
0
votes
0answers
18 views

Metabox collapsed by default

I need to make a metabox of a WordPress Plugin called "post expirator" collapsed by default. Right now it is open. actually when i open a page : My need : That is the part of the code adding ...
0
votes
0answers
14 views

<li> shows outside of <ul> in custom post type template

I have a custom post type template and a list with several items inside displaying data form advanced custom fields, this is my template code for the list <ul class="game-meta-data"> ...
0
votes
1answer
25 views

Custom query result empty on page 2

I'm trying to filter paginated results of my custom query. I've got 4 posts, 3 per page, total of 2 pages. When I apply the filter while on page 1, it works. When I apply the filter while on page 2, ...
0
votes
1answer
26 views

How to order taxonomy terms by most recent post?

I have a list of terms showing in slug order but I need to order them by most recent posts, so it will be changing depending on what term has the most recent entries... Is there a way to do so? I ...
0
votes
1answer
23 views

I have a random letter appearing before my content. Where to start looking for the cause?

Something weird is happening. I'm running Wordpress on a local DesktopServer. Suddenly, as in today, the letter "d" has started appearing before my content is random places. In short, it appears on ...
0
votes
1answer
21 views

Archive links for custom post types

How do you display a list of archive(last 6 months or so) for custom post types? Something like this: https://blog.evolveformazione.com/
0
votes
0answers
19 views

Pagination on custom post type without plugin

What's the best way to display pagination on a custom post type archive page without a plugin? I tried paginate_links() didn't work. I'm using a custom query and here's the code: $args = [ '...
0
votes
1answer
36 views

How to overwrite function to display parent page combobox for custom post type in Edit Post Page?

For some reasons I´m using get_post_ancestors() to display parent pages. In my theme, I wish for my custom post type choose a simple page in the parent page combobox. By default my custom post type ...
0
votes
1answer
14 views

Meta query and compare “!=” not working as expected

I realize that maybe this could be an already submitted question and I searched for it, but couldn't find it. I've got the following simple meta query: if (!is_admin() && ...
0
votes
1answer
14 views

remove duplicate name submenu link from the custom post type

I was wondering what would be the proper way to remove submenu with duplicate name in custom post type in the admin. I tried to use remove_submenu_page() however since its a duplicate it is showing ...
0
votes
0answers
12 views

Shortcode to show the number of custom post type taxonomy

I would like to create a shortcode to show the number of taxonomies of a certain custom post type: I would like to show with the shortcode the number of "coupon_stores" and if is possible another ...
0
votes
0answers
11 views

Adding query argument after slash in URL

I am trying to add a parameter at the end of my custom post type page to do some pagination. I've added the following to the functions.php but wordpress still throws me to 404 page add_action('init', ...
0
votes
1answer
46 views

how to display posts content on the custom css popup by clicking on each title on the sidebar?

I want to display post titles based on post_tag from default post_type concat with post_category from another post_type named 'update' on the sidebar. And finally When users click on each title it ...
1
vote
1answer
19 views

How to have the same url structure for both a CPT and a Taxonomy?

I have a post type called worksheets and I have a taxonomy called worksheets_category. I want to have the following url structure for both. worksheets - example.com/worksheets/sample-single-page ...
0
votes
0answers
22 views

wordpress get menu id by custom post_type?

I'm trying to figure out how to get a menu id by it's post_type, is that possible? I need to get the menuid of my post_type 'events', but I'm not sure how. If anyone could help that would be great.
0
votes
0answers
23 views

Custom Search For Custom Post Type and Taxonomy

This is my first question. I have a custom post type: quote. I'm using a non-hierarchical taxonomy quote-writer to show the author of the quote and a hierarchical taxonomy quote-topic to show ...
0
votes
0answers
18 views

custom post types, custom fields and normalization

I have decided to redesign a plug I developed to use custom post types and custom fields instead of custom tables in the database. I have some questions about abstracting data into new post types. ...
1
vote
0answers
14 views

How can I display my custom posts type in a monthly calendar view?

I am looking for a way to display my Custom Post Type posts in a full-page monthly calendar type display (like what you see in Google calendar). Ideally, the calendar would be dynamic in which user ...
0
votes
0answers
16 views

Assign custom field value to taxonomy child terms

I am trying to assign the values chosen by the user from a dropdown list of custom field values to a custom taxonomy. It works perfectly if the taxonomy is not hierarchical, but I have no idea how ...
0
votes
0answers
21 views

Category filter in the archive

I want to display in the page.php all category (now it's do it) but when i click to a specific category, then it's go to the archive.php and dipslay me all category again, but i want display the post ...
0
votes
0answers
6 views

Shared taxonomy and query performance

I have a question about shared taxonomies. I have 6 multiple custom post types and each of them should be categorized by a City. They're different CPT because each of them comes with a rather ...
0
votes
0answers
31 views

Wordpress CPT url structure

I have created a CPT called "listing". I've attached 2 taxonomies to this CPT : listing_type listing_city Is there a way to structure my URLs as below : https://example.com/listing/%...
1
vote
0answers
18 views

How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?

I am working on a test. Where i want the follow to be able to work: https://1587469162.webton.dev/referenties/ = page https://1587469162.webton.dev/referenties/hoofdcategorie/ = main taxonomy https://...
0
votes
1answer
28 views

List taxonomies by post id

To start with I'm pretty new with php so any nice kind person who agrees to help me, please be gentle. What I want is generate a list of taxonomy terms that are associated with a specific post id. I ...
0
votes
1answer
12 views

Custom post type and custom taxonomy key lenght & query performance

I'm creating new custom post types and taxonomies for my client and I wanted to prefix their keys so there is no conflict with any plugin that could be installed that would be providing it's own CPT ...
0
votes
1answer
24 views

show_in_rest false disable Gutenberg

When I declare a CPT with 'show_in_rest' => false, Gutenberg editor is disabled for that post type. Is this an expected behavior?
0
votes
1answer
35 views

singular_name label in custom post type

I was looking to get more info about 'singular_name' label and came across this link. Based on that link 'singular_name' value should show up when I click 'Add New' and 'Add New Post' window appears. ...
0
votes
1answer
8 views

Check for a specific taxonomy of a custom post type

I have a books custom post type, I want to do something only on the 'book_categories' pages and other stuff on the 'book_year' pages. How do I check if I'm on those taxonomy pages?
0
votes
1answer
35 views

How do loop categories post from according in WordPress? is it impossible to solve this problem?

I have to get help from Tony about build accordion WordPress but in the loop, its repeated the same three posts and I don't know how to make a loop with the right way when clicking on category I must ...
0
votes
0answers
18 views

Get Posts from Specific Custom Post Type Seperately on Taxonomy Page (tag.php)

I am trying to Get List of all custom post type (Album) for the current tag (post_tag) page (tag.php). Lemme explain further: E.g I used Drake has a post_tag taxonomy while posting Albums (album ...
0
votes
0answers
12 views

WordPress Page hierarchy ( parent is singular of custom post types slug ) is returning not found

I have a custom post type called CASINOS with slugs is casinos wich has _archive set to false and I have a page called Casino with slug casino ( singular) The problem is when creating a child with a ...
0
votes
0answers
9 views

Get all custom post types taxonomies but exclude by name

I have 2 custom post types and each one has a 1 taxonomies added to them but I want an array that pulls 1 taxonomy from each CPT and display it normally. I have this code which pulls every taxonomy ...
0
votes
1answer
13 views

Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?

I am creating an educational website and some of my pages are "subjects" like math, physics etc and I want them to be searchable. How do I do this? I thought that it would be easy if I just made a ...
1
vote
0answers
36 views

create a subcatagory for a custom post type and out put url as posttype/subcategory/item

I have created a custom post type called 'game' using the CPTUI plugin, the plugin dev has been very helpful in helping solve some issues but what I am trying to achieve is beyond the scope of what ...
0
votes
0answers
10 views

Custom Post Types Not Showing in Wordpress Feed

I'm trying to add Custom Post Types so they show in my Wordpress feed i.e. the url on my local machine being http://localhost:8888/example/feed On various articles on the internet I've seen the ...