We’re rewarding the question askers & reputations are being recalculated! Read more.

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
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
28 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
80 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
37 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
14 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
33 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
24 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
24 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
65 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 ...
0
votes
1answer
15 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
13 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
17 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
16 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
36 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
26 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
57 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
20 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
34 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
17 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
20 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
18 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
36 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())...
0
votes
0answers
31 views

Get 404 error page in use 2 custom taxonomy

i use 2 custom taxonomys. first for topics (chordlist): register_taxonomy('topics',array('post'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, '...
0
votes
0answers
15 views

What would be the best approach for querying posts with multiple templates from a custom post type

I'm a bit stuck with querying all the posts from a custom content type where posts have multiple templates and display all the posts on a page. As shown from the image below, each block inside the ...
0
votes
1answer
32 views

Query custom post type and custom field by URL parameters

I have a custom post type staff. and a custom field alphabet for posts in that post type. Each staff will be assigned to a letter either A or B ... Z based on the first letter of the staff's name. On ...
0
votes
0answers
51 views

Post Type Search Gives Unexpected Results

I am working on a WordPress site that has several custom post types. Of course this lends itself to writing a custom search form. However, the results from test searches have been less than ...
0
votes
0answers
26 views

Multiple Pretty Permalink Rewrites for Custom Taxonomies

I have a custom post type and two custom taxonomies. I'm already successfully rewriting the first taxonomy titled 'type' to website.com/post_type/tax_term. I am doing so by adding the following ...
1
vote
3answers
14 views

Archive template not working for custom post type

I am registering a custom post type called "Products & Services". I have created a file within wp-content/themes/theme/ called archive-products&services.php but it's not using this file. I ...
0
votes
1answer
30 views

Custom Post Type Capabilities Singular/Plural

Just for clearance, if i add a custom post type with: register_post_type( 'event', array( 'labels' => array(…), 'capability_type' => ['event','events'], '...
0
votes
0answers
15 views

Unable to add Multiple files to a custom post type with the help of custom meta box

Hi I am trying to attach multiple document to a post (custom post type). but unable to add them, i do not want to try with any 3rd party plugin,i have googled and tried some code which i am sharing ...
0
votes
0answers
16 views

Trigger refresh of admin menu

Apologies if this isn't an appropriate question for the forum, I'm new to wordpress development and needed to bring this question to some experts. I've written a plugin that creates custom post types....
0
votes
1answer
25 views

`save_post` hook called on inserting new post from front end

I have a front end form which creates a new post in a custom post type and adds some meta data to the post. I am submitting the form by checking for $_POST values in the same page in which form is ...
0
votes
1answer
20 views

Some posts not displaying by taxonomy term

I've run into something very odd that I don't think I've ever seen before. I'm trying to query a custom-post-type and organize the results into groups by a custom taxonomy term. The post is Project ...
0
votes
1answer
20 views

Remove single page for custom post type

I have a custom theme with a bunch of custom post types. I want to keep my "news" post type to display as a paginated list (that links directly to the external news article - already figured this part ...
0
votes
1answer
32 views

WP_Query to display number of custom post type filtered (order by) taxonomy

I am trying to display the number of posts made in custom post type "incidents" by the custom taxonomy "store". eg. Store 1: 8 posts Store 2: 6 posts etc. I have been looking through here and ...