Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-post-types]

Custom Post Types extend the WordPress back-end to support additional, non-Post content.

-1
votes
0answers
8 views

Mapping custom post URL, Structured Data & SEO through Ultimate CSV importer [on hold]

I want to change the link of my custom post type. I couldn't see any mapping field to match to the column. Is it available in the pro version or not? I don't want to change the post title so as to ...
1
vote
2answers
19 views

Site not reachable due to change of url from http to https

I tried force ssl certificate without observing all parameters, not understanding how it works, at my backend wp-admin, setting, changed http to https and now can't see my backend any more and when i ...
0
votes
2answers
314 views

Copy order items with metadata between orders - Woocommerce

For some custom functionality in Woocommerce, I need to copy order items with all metadata from one order to another order programatically. The source order is of type WC_Order while destination order ...
1
vote
1answer
21 views

“add_post_type_support” with Custom Post Type & ACF

I have a Custom Post Type named conferences (same slug, supports custom-fields), which is using the Advanced Custom Fields plugin. One of those custom fields is "conference_date", which I want to ...
1
vote
4answers
2k views

Adding help information to custom post edit page

I have two custom post types created (using Types plugin) with a bunch of custom fields. I need to add a help information, instructions for admins that will show at the top of add new/edit CPT page ...
0
votes
1answer
6 views

Migration in new Custom-Post-Type-Structure

I have a question I'm not getting anywhere on. Maybe you have an idea how I can solve my problem. Initial situation: We currently have a blog with a lot of posts (150 posts, 7 categories and several ...
0
votes
1answer
42 views

Wordpress Permalink Custom Post type

For the Permalink on wordpress setting I have /%category%/%postname%/ This will show Post in different category like /blog/post_title_1/ or /event/post_title_1/ but now I have some Custom Post ...
1
vote
1answer
25 views

Custom post type permalink changing itself every other change

I have created a parent > child > grandchild structure. (Courses > Series > Episodes). I have created the below code which updates the urls for each of the custom post types so that I can have the ...
0
votes
0answers
4 views

Restrict authors from viewing each other comments in the post

As the title says im trying to find a way to restrict what authors can see. Im using custom posts and Authors can view each other posts but how to hide the comment section if the post is not owned by ...
0
votes
2answers
25 views

Should I create Custom Page Types?

I'm creating my first Wordpress theme and I learned about custom post types. They sounded great for different reasons and I really wanted to implement them. But I read somewhere that when the user of ...
0
votes
0answers
15 views

Private Custom Post Type for a Blog? [duplicate]

Just wondering if anyone can point me in the right direction please, it may not be possible - but just thought I'd ask incase. I currently have a marketing website for a school campus, within that ...
0
votes
1answer
830 views

Related post without plugin for custom post types

I need some help modifying this script. I am trying to also show related posts by custom taxonomies and custom post types. //* Define custom image size for featured image in Related Posts ...
29
votes
3answers
48k views

How come Featured Image isn't showing up in my Custom Post Type?

I have thumbnail support added with the following in my functions.php // Add Thumbnail Support add_theme_support('post-thumbnails'); set_post_thumbnail_size( 140, 140, true ); And I create the ...
0
votes
1answer
753 views

Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?

i'm making a photo gallery for a plastic surgery website, with before and after photos of patients. i made a custom post type /photo-gallery and a taxonomy /procedures, after reading this post i was ...
1
vote
1answer
774 views

How to publish custom post type for custom role user and not “submit for review”?

I've created a custom post type 'openproject', where i set capabilities. function custom_post_openproject() { $labels = array( 'name' => 'openproject', 'add_new' => 'Add new ...
0
votes
0answers
16 views

Custom Post Type with categories permalinks

I created custom post type named "Bikes" and four categories (Road, Scooter , Offroad and ATV) and each category have subcategories which I can use to assign custom post entries to. So when I viewed ...
0
votes
2answers
25 views

Dynamically add a unique number/identifier at the end of post titles

I am currently developing a small recruitment style website, and have encountered an issue. I have created a form (Using Gravity Forms) that allows users to create a custom post (Current Vacancies) ...
-1
votes
2answers
17 views

ACF - Query relationship without ID

i have different CPT ( hotel, market, city, etc… ) My relationship field is used to link CPT to cities (CITY). Now in a page ( hotel page ) i want to link “other hotels in same city”. how can i ...
0
votes
1answer
1k views

Add custom column to post list table

I have a custom post type called Book and I want to add the publisher and book author custom columns in the edit page. I also want to fetch a specific value from each fields (I created two fields ...
3
votes
1answer
1k views

How to show the taxonomy assigned to a post in the table (where all the posts are displayed) of the custom post type?

Right now I use the following code to create a custom post type and assign a taxonomy to it: // === CUSTOM TAXONOMIES === // add_action('init', 'my_custom_taxonomies', 0); function ...
1
vote
2answers
4k views

Paginate_links links not working accordingly to how I do query the page

Ok, I've a custom post type page to which I have attached the paginate_links function to navigate through the elements. If I don't do anything and let WP using whatever mechanism is attached to the ...
0
votes
2answers
4k views

WP_query parameters for date range

I'm using the events manager plugin to create custom posts for events. I do not have a need for a blog, so I modified my theme's index.php file (using a child theme) for its query to retrieve the "...
1
vote
2answers
837 views

display multiple term post from taxonomy in a single page

I have custom post type name "resources" and taxonomy called "type" with lot of terms in it. I do not want to create custom template for each term like taxonomy-type-{term}.php every time I add new ...
1
vote
0answers
16 views

Wordpress custom post type permalink rewrite shows page not found

I need to have 3 custom post types in my wordpress site, each one being a parent of another. Courses > Series > Episodes I have fully created a functions file that registers the custom post types ...
0
votes
1answer
138 views

Custom Post Archive is not working

I have created WordPress plugin for my custom post. I have tried all solution for archive, which I have found on Youtube and StackExchange but none of those are working. I have refreshed permalink ...
0
votes
1answer
907 views

Custom post type archive pagination with HTML5Blank theme?

Can't get the pagination to work. Here's my archive-work.php: <?php get_header(); ?> <main role="main"> <!-- section --> <section> <h1>&...
2
votes
1answer
24 views

How to display recent / random posts by its category

trying to display random posts from each category that my custom post belongs to (it is related to 2 categories). I am trying to get post categories by id. I have tried to put category ID manually but ...
2
votes
1answer
84 views

Output the slug and name of a CPT single post taxonomy term

When I'm on a single post for a custom post type, I want to be able to grab the slug and name of the taxonomy term so I can insert them into a link. Below is what I've tried but it doesn't seem to ...
18
votes
5answers
32k views

Possible to hide Custom Post Type UI/Menu from specific User Roles?

What I'm looking to do is completely hide the UI for a custom post type from specific user roles...Ive previously found many resources on how to disable access to using those CPTs but nothing that ...
1
vote
3answers
836 views

Loop to fetch 3 post_thumbnail instances from 3 most recent custom post types named “portfolio”

I am trying to display 3 post_thumbnails from a custom post type "portfolio" on my homepage template. So one from post 'A' , one from post 'B' and one from post 'C' The image from post A will be set ...
0
votes
1answer
10 views

How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug

I'm setting up "special" url structure for posts etc Result i want to get is: sitename.com/club/justcavali club is term from taxonomy (club_type) and justcavali is post type (booking_type) after i ...
2
votes
1answer
29 views

Sort by two dates. Default entry date and custom field if present

I have a custom post type where there is an option to sort by date. There is however a custom date field that allows changing the display date. This custom date field is not always filled. Right now ...
1
vote
1answer
13 views

Update CPT post meta with update_post_meta and cron job

I'm attempting to regularly update a custom field ($company_rating) in a CPT with update_post_meta(). The cronjob is assigned and working. I've tested the function and it prints correctly (I've ...
0
votes
1answer
1k views

Display Posts in Custom Post Types Timber

I am working on a Timber/Twig template and have created a Custom Post Type with a Taxonomy specific to that Post Type. $tour_labels = array( 'name' => _x( 'Tours', 'Post Type ...
0
votes
0answers
20 views

Woocommerce search pagination not working

I have a problem with the Woocommerce Pagination but only on the Search Page. On category sites the pagination links are working just fine. But on the Search Page the pagination generates links like ...
0
votes
1answer
34 views

To display the category of a specific custom post type

I apologize for my English, but I am French. In my custom search page I display the results of my custom post type and everything is good. Only, I would like to display above the custom post type the ...
27
votes
4answers
42k views

Capabilities and Custom Post Types

I have a custom post type that I'd like to restrict access to certain roles however, I've already added content using the custom post type and now I have to make them restricted. The capability_type ...
6
votes
2answers
29k views

Query by post title

I've used a custom post type for one of my website. Custom post type contains scratch card data along with some custom fields. I've developed an android application to manage those items from android ...
0
votes
2answers
26 views

Tell wordpress to show a single page instead of an archive page

my wordpress site urls like this: https://example.com/?pid=a125a5&lang=en and query of my archive page like this: <?php $the_slug = get_query_var('pid'); if ($the_slug){ if ( $post = ...
0
votes
1answer
1k views

Remove custom post type slug but keep related category taxonomy permalink

struggling as well with custom url rewriting for custom post type taxonomies. Here is my requirement: domain/mycpt_category/postname/ It's well documented here and in several SE threads removing ...
1
vote
1answer
2k views

Can you link custom post types to pages?

The reason i ask is because when i create pages they don't insert the usual name of the post type like CPT's do. For example if i create a page called toyota the URL would be http://domain.com/toyota,...
0
votes
1answer
1k views

Creating a search results page from a custom post type in a plugin?

I have a forum system where I created a custom post type, and I would like to have a search system for the topics, but I do not know what the structure would be, for example, how the file will be and ...
12
votes
1answer
2k views

Custom media upload content for inserting custom post shortcode

I’m working on a plugin that creates custom post type “portfolio” along with shortcode to insert in any page or post. The shortcode is: [portfolio option1=“1” option2=“0” option3=“1” ] And it works ...
3
votes
2answers
4k views

Displaying Meta Box Image

I have some problems displaying info from my custom meta box in my custom post type single. I'm using Reusable Custom Wordpress Meta Boxes by Tammy Hart. I'm able to display the textfields using this:...
0
votes
1answer
2k views

Creating post custom field text area

I want to make, I guess a custom field for my theme. I'm not sure is it the right way to do this with custom fields. I searched a lot, but could not find what I need. So I'm hoping that some one ...
1
vote
1answer
22 views

post_type_link filter causes 404 on the CPT page it's used on

When i change the permalink of my CPT using filters it gives a 404. I clicked save in the permalinks settings and switched and saved, but there's still a 404. Is there some kind of hooking up i need ...
1
vote
0answers
7 views

How to set a CPT to have a page as a parent, then rewrite urls accordingly?

i have a CPT (called review) for review pages and I want to set these as children of pages i've created. right now my CPT slug looks like this: example.com/review/chewy-review but i have a page on ...
4
votes
1answer
3k views

Ordering posts by custom taxonomy in admin area

EDIT @kaiser - this question is slightly different to the answer you posted in that I am talking about sorting by clicking the column title rather than adding a dropdown to filter by taxonomy term (...
1
vote
2answers
1k views

save_post custom post type ? $_POST not working?

i have this code. <?php add_action('add_meta_boxes', 'ct_meta_add'); add_action('save_post','ct_meta_save'); add_action('save_post','ct_parent'); // add meta functions function ct_meta_add() { ...
0
votes
0answers
16 views

Include only recents custom posts in WP rss feed

How to disable lastBuildDate for rss feed and include only the posts created recently (ex. 3 days before now)? If there is no post, let the feed be empty. I wants to show only recent posts in rss ...