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.

0
votes
0answers
5 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
0answers
9 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
0answers
14 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 = ...
1
vote
1answer
21 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
27 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 ...
0
votes
0answers
11 views

How to Select post parent for CPT from another post type?

I'm developing a Sports website, covering cricket football, etc. The goal is: .pk /cricket (Landing page) .pk /cricket/ipl (IPL Landing Page) .pk /cricket/ipl/year (IPL Landing Page by ...
1
vote
1answer
14 views

Working with Next and Prev links in Single Taxonomy Templates

I am building an art gallery website using a custom post type "paintings". There is a custom taxonomy for categories called "painting_cat" where it can be "studio", "plein air" etc., and another ...
0
votes
1answer
12 views

Get posts in custom post type categories

I have a custom post type defined like so with taxonomies are standard categories: // Register Custom Post Type function custom_post_type() { $labels = array( 'name' => _x( '...
0
votes
0answers
13 views

Extended Custom Post type get all posts in wp-json

Using johnbillion/extended-cpts I try to figure out how can I have all posts in wp-json response. Till now what I tried did not worked I registered the post as it follows ...
-2
votes
0answers
7 views

Fill svg with thumbnail [on hold]

I try to fill an SVG with an image using pattern, like that : <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 370.75 318.57" preserveAspectRatio="xMinYMin meet"> <defs> &...
0
votes
1answer
21 views

Get parent category(taxonomy) ID from single template of a custom post type

-Parent-category -Sub-category Want to get parent ID when on the current post of sub-category. Created a custom post type and custom taxonomies for that post type. Created a category and assigned ...
0
votes
0answers
16 views

Custom permalink and query with parent_post

I have a custom post type called recordings and they have a post_parent of room I want to have a link of domain.com/recordings/{{room-slug}}. But I dont think I can use the slug like I want to so if ...
0
votes
0answers
16 views

Mystery with permalink: works only with Custom Post Types and not with Posts and Pages

My permalink works only with Custom Post Types and not with Posts and Pages. The permalink structure is https://mainsite.com/mysite/%category%/%postname%/ I'll break down the details of the mystery: ....
0
votes
1answer
17 views

How to display grandchildren only of custom post?

I am trying to display the grandchildren of a custom post type. The structure is is fairly simple: Issues Issue 1 Article 1 Article 2 Article 3 etc Issue 2 Article 1 ...
1
vote
2answers
131 views

Create Pages from Database

i've recently decided to create a website with wordpress. My goal is to a visualize data stored in a MySQL database. Each id in the database should represent one page on the website. From what i've ...
0
votes
0answers
19 views

REQUIRED: The theme uses the register_post_type() function, which is plugin-territory

I am developing a car rental theme, but I encountered a big problem, when I upload the theme I get the "REQUIRED: The theme uses the register_post_type() function, which is plugin-territory" the ...
0
votes
0answers
5 views

Checkbox with multiple choice, custom fields problem database record and missing line break in the custom field description

Currently creating a website in Wordpress during an internship, I created a custom message type with a checkbox multiple choice but also a description field with the wordpress editor I encounter a ...
0
votes
1answer
14 views

Display Custom Post Type Archive content with Shortcode

So I've created a custom post type filled with Advanced Custom Fields only. There is no "content". I've created a single-custom.php, content-custom.php and archive-custom.php. All looking nice and ...
1
vote
1answer
24 views

Completely remove custom post type permalinks (“One Page” website)

I created a one page style website that I converted to WordPress. The website include a blog, but I'm not using the usual WordPress way to display the post as I'm using a modal window appearing on ...
0
votes
1answer
22 views

Modify Url for Edit Post Screen in Custom Post Type

Ive looked at the questions that may have already answered what im needing and came up short...Im modifying a plugin and the custom post-type name shows in the url when adding a new post. But..when ...
0
votes
1answer
23 views

Custom Post Type Categories URL not displaying posts

I'm not as good as many wordpress developers here and I hope someone can help me, I've created a Custom post types for hotel destinations with categories for country and city. When I go to mysite.com/...
0
votes
1answer
13 views

Getting arguments for register_post_type from a plugin generated post type

I’ve taken over website from another developer and they used a plugin to generate a custom post type. The plugin is no longer maintained and is causing an error 505 when try and load the plugins admin ...
0
votes
0answers
20 views

Add select filter based on acf field to custom post type in dashboard

Good morning everyone; I am trying to add a select filter like this: Select filter based on taxonomy To do this, I am getting all field values like: Display all select field values I am able to ...
0
votes
1answer
33 views

How to get post by meta value

I am trying to get post of custom post type by two meta value but it does not work. I have followed lots of article but not worked below are my code. Note: 1. first meta value is a type of date eg: '...
-1
votes
1answer
14 views

Auto post creation

I've a problem in wordpress that I find automatic posts getting created.. I couldnt figure out what is causing that.. Is this can be from a plugin? You can see in the picture an example of those posts ...
0
votes
0answers
29 views

Sort custom post archives by a meta value from a different custom post type?

To make a long story short, I have a custom post type called artworks with these meta fields: title catalog_no artist_key I have a second custom post type called artists with these meta fields: ...
0
votes
0answers
10 views

Blank revision upon save

Sometimes when a user saves a custom post type, WordPress saves a blank revision (see below) I only have ACF installed as a third party plugin, I see no errors in my error_log that are related. I ...
0
votes
1answer
29 views

Merge multiple custom post types in a single archive template

I have multiple custom post types, viz., research, documents, booklets. I have a single archive template for each of them , archive-research.php, archive-documents.php, archive-booklets.php ...
0
votes
0answers
37 views

Permalink for custom post type pages not working

Having some trouble with pagination and custom post types. I have 3 custom post types active currently: 'webinar', 'resource', and 'faq'. For each of these custom post types, I'm using the archive-{...
1
vote
2answers
63 views

Problem fields custom date, time, and checkbox

I created a custom post type with custom date, time and checkbox fields. I'm having a problem with the date and time fields that do not register in WordPress Administration or in the database. And ...
0
votes
0answers
12 views

CPT using DataTables as content - still editable on website pages

I'm trying to use the jQuery plugin DataTables with WordPress. I have created a CPT that contains a DataTable as content of post. Then I have a meta box with the DataTable (not using the Editor ...
1
vote
0answers
18 views

How to checked selected category checkbox when my custom post inserted from frontend

if ( isset( $_POST['save'] ) ) { if(wp_verify_nonce($_REQUEST['_nonce'], 'submit-post')){ // $userid = get_current_user_id(); $atts = array( 'post_content' =&...
0
votes
0answers
19 views

Taxonomy counter on Taxonomy List(plugin)

I'm using this plugin (Taxonomy List by Muhammad Rehman) and apparently is not longer on develop or support. I need to show the main taxonomy (custom from my theme) and the child's taxonomies with ...
1
vote
1answer
30 views

How to only show posts assigned to current user, only in certain post types

im trying to get this code to work. in admin id like to only show posts assigned to current user, only in certain post types like: shop_order, pages, posts. But show all posts in other post types ...
0
votes
0answers
33 views

Notice: Undefined property: stdClass::$delete_posts with custom post type

I created a custom post type called gdpr_qao and I set 'capability_type' => array( 'gdpr_qao', 'gdpr_qsaos' ) in register_post_type arguments. On main custom post type screen I get: Notice: ...
0
votes
2answers
30 views

Change WordPress custom field default calendar [closed]

I have a custom post type called X, Post type X has some custom fields, one of these custom fields is date, <input type="date" name="date_added" id="date_added" class="regular-text" value="<?...
0
votes
0answers
11 views

How to show custom post type only within network admin dashboard

I am developing a multisite plugin. So I need a custom post type to manage few things within the plugin. I would like to use the inbuilt custom post type feature of WP. But the issue here is, we can ...
2
votes
0answers
22 views

I am facing problem in my archive page , it is partially working

I am using wordpress 5.1 and I am creating a blogging website. I am having an issue in my blog posts: when I click the permalink(link) of category it is showing the output but when I click the author ...
0
votes
1answer
22 views

How to retrieve category of a post in have_post loop?

I am using a CPT (post_type => 'portfolio_type', taxonomy => 'portfolio_cat'). Under this CPT, I have design, web development category. I am trying to get the post with the category. My best try, ...
0
votes
1answer
22 views

Check if user has custom post published redirection on WordPress

I am trying to run a check when a user visits a certain page to see if the current user has a published or draft posts of a custom post type. If they do, then I'm trying to redirect them. I've found ...
1
vote
1answer
26 views

Using custom field content as expression in IF statement [closed]

I want to store some conditional logic in custom post types , and then use these in a plugin to generate new content based on the logic. Eg if a user submits a form with “body temperature”, a ...
0
votes
1answer
16 views

Cannot save pages after migration

Recently I've received a task from my clients to improve their company page. I've migrated the page to my VPS and made some modifications: added new content updated Wordpress updated plugins ...
0
votes
2answers
16 views

Custom order of Taxonomy Terms

I'm querying a custom post type and displaying all posts by terms (basically posts by category) as follows, everything is working fine EXCEPT for some reason no matter how I write the tax_query array, ...
1
vote
1answer
44 views

Can't query tag and post_type at the same time

On my developer site this query is used for a carousel in index.php : $vedette_accueil = new WP_Query(array( 'tag' => 'vedette-accueil', 'nopaging' => ...
0
votes
0answers
30 views

Why is my site using index.php instead of archive?

Developing my first custom theme and I started out using an individual page-$slug.php to display a list of each custom post. Have since learned that archive.php is better for this purpose (but I just ...
0
votes
1answer
32 views

Dynamic CPT / Taxonomy

I use multiple CPT / Taxonomies / Terms in my website. Currently, to customize, and use the good WP template, i've made a taxonomy-$taxonomy.php file for each CPT. But in fact, it's ONLY the CPT and ...
0
votes
1answer
32 views

Custom post type permalink returns 404 when set to private

I have a custom post type that is configured to use a permalink structure prepended with the post type name. When using get_permalink(), the URL that is returned does not include the post type name. ...
0
votes
0answers
18 views

Wordpress doesn't respect Page slug in custom post type url pagination. Keeps getting removed

I have a custom post type, Company, with respective company child pages. Whenever I attempt to go to a page url eg. http://example.com/company/example_company/page/2, the /page/2/ gets striped from ...