Questions tagged [custom-post-types]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
14 views

How do I get the intended post type of a revision post?

I have a headless Wordpress instance with multiple custom post types. The build takes a few minutes, so I'm building a way to display drafts by fetching the latest revision via an API, like so: $...
0
votes
1answer
13 views

Convert category to custom post type

Currently our site's products are defined by two categories: food and drink. It would be useful to convert this categories in two post type for better management of contents. We cannot find ...
0
votes
2answers
48 views

Get only one custom post from each category

I have create custom post(book). In which i have five texonomy categories: CatA, CatB, CatC, CatD, CatE. & i want to show only 3 posts and i want that these posts coming from CatA, CatC, CatD.(One ...
0
votes
1answer
39 views

How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?

I am using wordpress and pods for building a web app. I have created different custom post types like "project" , "task" and "material" and each of them have various different custom date fields. I ...
0
votes
0answers
30 views

Static Front Page not working for custom theme

I'm building a custom theme for a client... I am trying to set up a static front page, but no matter what page I select it falls back to a custom post type archive page. I have confirmed that I can ...
0
votes
0answers
24 views

Add class attribute in Custom Post Type

I'm using CPT library and I don't understand how can I add the class attribute on a single input field, I create all the post input as array item: array( 'label' => esc_html__( 'Property ...
0
votes
0answers
18 views

ACF category as taxonomy

I am new to ACF on wordpress and trying to understand how every part works on it. Using 3 plugins: ACF PRO CPT UI ELEMENTOR PRO I have created custom post type "FLATS" I have created custom ...
0
votes
0answers
18 views

Is there a way to create a sidebar of bullets

On each individual post im trying to create a sidebar for my sources of information. is it possible to have a sidebar labeled sources with bullet points coming from it that im able to put links?
0
votes
1answer
27 views

Link From Single Post To Taxonomy Term Archive Page

Need to add a link on all single pages for custom post type taxonomy terms which links back to the taxonomy term archive the single page belongs to. Using this code but it adds links for all tax ...
0
votes
1answer
17 views

How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?

Example: 4 most recent regular posts 6 posts queried from custom post type 8 regular posts ( most recent posts with a 4 post offset so that it's a continuation of the first four posts on the page) ...
0
votes
0answers
14 views

custom search refreshing on submit and not giving results

The custom search refreshes on submit and also does not give any results. I am not sure what is wrong with the code but if someone could take a look at it to help me see what I am missing, I would ...
0
votes
1answer
27 views

Custom Wordpress theme not displaying posts from category

I am creating a custom Wordpress theme and as far as I can remember Wordpress is supposed to do the heavy lifting for filtering of post types by their category, author, etc. on it's own. This is just ...
0
votes
0answers
10 views

Print images from a custom DB in differnet posts

I´m kinda new in Wordpress , i have a question , i hope you could help me ,i have many images in a DB , i wanna implement something in posts , the posts have a default thumbnail image , this appears ...
0
votes
1answer
25 views

Where to put code for coding Custom Post Types?

I’m wondering what is the best place to put the php code for defining custom post types. Looks like theme functions.php is a big no-no because CPT are lost when switching theme Wordpress codex ...
0
votes
0answers
16 views

Category page don't show custom post type

I have a problem with category of custom post type. If i categorized posts (for example in "test" category) and than if i click in this category I see all post that categorized "test". That is good ...
0
votes
1answer
9 views

Create and Update 2 CPT sequentially

Is it possible to create + update a CPT after a post have been created sequentially in the same flow? For example: First: I do a wp_insert_post($my_first_cpt) (with some data, and it's executed on ...
1
vote
3answers
75 views

Custom Post Types with a common category for a blog listing

My client wants to have the ability to call up a common category used in multiple custom post types. So if there is a common category of "budget", then a blog listing would come up with all the custom ...
0
votes
0answers
36 views

Permalink Rewrite Rule Issue in CPT

For a custom post type blog in my site, I want to have the following permalink structure: mysite.com/blog/post-slug/post-id I am using the following code in my theme: function blog_links($...
0
votes
0answers
10 views

Unable to correctly $counter for Pagination

I have a page that displays posts by category: https://www.worldwideholidaysclub.com/holidays/ But, I want to have different pages for the main tags in order to promote the pages separately. My ...
1
vote
1answer
13 views

Custom post type suppress transition from future to publish

I've scheduled a custom post type to a future datetime. Now I won't that it will be published automatically, instead it should switch the status to draft. We use this to pulish the webinars, so we ...
0
votes
2answers
30 views

Create post and update in the same flow [closed]

Intro: I'm using a weird plugin called The Events Calendar which vastly operates outside of WP functions. For example, I cannot retrieve custom fields with the WP function. So essentially, my problem ...
0
votes
0answers
17 views

Wanting to list all Post types under a common category

A client has "posts" plus four custom post types on their site. He requested a way to call up a category that would be common to the CPTs and list them all. So if there is a common category of "budget"...
0
votes
2answers
20 views

How to get all post of custom post type by rest api?

I have CPT transcript in wordpress website. And create 250 post in CPT transcript. Now, I want to fetch all transcript data and want to store in another database using rest api url http://example.com/...
0
votes
1answer
23 views

From CPT Custom Loop into Shortcode?

Let me first start with; I'm far from a programmer, but I'm getting into it a bit. Currently I managed to make this loop for a CPT called 'studentensteden'. Now I would love to make it into a ...
0
votes
3answers
64 views

Custom post type in slider front page Breaking layout

In WordPress, I am pulling data in from an api and using custom post types to display in owl-slider. For some reason, my code is breaking the slider layout. I will post the code below. <form> ...
1
vote
1answer
21 views

Re-registering a custom post type not working (not showing up)

I registered a custom post type, but then I changed register_post_type( 'studentenverenigingen', $args ); into register_post_type( 'studentenverenigingen', $args ); . Now my client wants it back to ...
-1
votes
0answers
13 views

WordPress Custom Post Type Admin area Meta tags option not show

How to setup meta tags in my WP Custom Post. Please provide details.
0
votes
1answer
14 views

Can't see post status drop down for custom post type

I have a custom post type called Group for that I have assigned all required capabilities to Admin. However, I am still not able to see Status (post status) dropdown on edit screen. Admin ...
0
votes
0answers
20 views

Display products by attribute on category pages

I'm looking around a solution for displaying products by attributes (pa_size and pa_color) on the product category pages. I have too much color and size options for my products. So, i want to create ...
0
votes
0answers
11 views

Add “Embed” Media type to Media Library

I'm looking for an alternative to the standard embedding work flow. I need all my embedded attachments to have the same meta data fields as uploaded content (description, caption, title, etc). The ...
0
votes
0answers
16 views

How to custom %postname% in custom post type

I've created a custom post type book and I want to add book-year taxonomy in post permalink. I want to change book permalink like this. https://domain.com/book/post-name-{book-year}/ I've to try ...
0
votes
0answers
12 views

How to allow dot(.) in slug for custom pages

For this question, I googled and found 2 results. But what I want to do is allow dots in slugs for some pages only. I found results are showing to add a function to function.php file. But it will ...
0
votes
0answers
22 views

My Site is not filtering posts as per Categories

So I made a custom taxonomy like this and named it blog-category function homekong_blog_categories() { $labels = array( 'name' => _x( 'Blog Categories', 'taxonomy general ...
0
votes
0answers
6 views

Attaching Multiple Posts to my site

I need to find a way to upload multiple posts to my site. Every post will have to show some text, the link of the game and an image. At the moment, I have to create one post at a time. I used some WP ...
0
votes
1answer
34 views

Pagination not working for archive

The query works for the default blog and pages but not for custom post archives. Did I miss something? $paged_bottom = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1; $...
0
votes
0answers
25 views

wp_editor in custom post type is not saving formatted text like bold, italic etc

My custom post type has 5 custom meta boxes which use wp_editor. Visually I can format the content but when saved, all the formatting is gone. For example I made a portion of my content bold, but ...
1
vote
1answer
32 views

Display different gutenberg template from selected post attributes

According to https://developer.wordpress.org/block-editor/developers/block-api/block-templates/, I have managed to add a template to the custom post type with the following code - /** * Portfolio ...
0
votes
1answer
19 views

How can I display a specific category on Front-Page

Please how can I display a specific category on Front-Page page, I want to display music category on my WordPress front page at least 3post on Front-Page, I don't know how I can do this
0
votes
1answer
24 views

register_rest_field update_callback don't work for $_FILES

I try to insert a post with REST API who contain text and image in one api call. My image is an acf field. I register my field like that: register_rest_field( 'project', 'logo', array( '...
0
votes
0answers
47 views

How to setup permalink structure for categories, sub-categories, custom post types and custom taxonomies?

I'm struggling to figure out how to setup the URL structure on a new WordPress. I've tried several combinations of custom (and default) post types, custom (and default) taxonomies, permalink plugins, ...
0
votes
0answers
36 views

How do i display all categories of a custom post type and have respective page for them?

I made a custom Post type named Blogs which is like this on the function.php function blog_post() { $labels = array( 'name' => _x( 'Blogs', 'post type general name' ), 'singular_name'...
0
votes
1answer
13 views

Get all of a user's posts (custom post type) then get cumulative value of a specific meta_key value from those posts

I'm trying to add property values for each user on a real estate website. I have a custom post type "properties." I'd like to take the "listing_price" from all of them and add them up to show how ...
0
votes
1answer
19 views

Custom Post Type has wrong label and is not found when called by a loop

I'm new to WordPress (and to code), having just started my classes. I am working on a project with a few students and can't find a way to call my Custom Post Type. I tried several solutions from ...
0
votes
2answers
16 views

How do you output an unknown number of images in a custom post type with desired markup?

I'm working on a theme that will have an image gallery within a custom post type. I'm able to insert them into the post (using Advanced Custom Fields and embedding them in a WYSIWYG box) but I was ...
0
votes
1answer
18 views

How do i make a listing page of custom post type?

So i made a function which makes a custom post type named Blogs. The Blogs is used to: All Blogs Add New Blog Blog Categories This is my function function blog_post() { $labels = array( ...
0
votes
1answer
22 views

How do i truncate content length to 500 words?

Hello I would to truncate my post content to 500 words on my single page post Please how can I do this using PHP?
0
votes
1answer
16 views

Update user_meta field from post_meta custom field

So far I have this. What I am trying to do is to calculate total value of two fields in certain CPT. After that, I would like to update that total value field to all users. I know that need to pass ...
0
votes
1answer
14 views

Change the term based on the value of a $variable using wp_update_post in submitting a form

Background I am using a fronted form to submit data to a meta box by use the wp_update_post to a custom post type (call) with a custom taxonomy (call-type). It then also updated the terms and ...
0
votes
0answers
32 views

Set a template on a custom post in the plugin

I looked at some answers and didn't help I'm trying the next section (right away) but it returns the template if errors in WordPress's built-in function lines. Like get_header () add_filter('...
0
votes
2answers
20 views

how to pass args for archive.php query?

I am trying to pass args to archive.php so that I can order the posts, set the number of posts, etc.. but the query is done like this <?php if (have_posts()): ?> <?php while (have_posts())...