Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
1
vote
2answers
28 views

Show ACF field from custom taxonomy and display on the single template

I have a custom post type called products, which I have attached a custom taxonomy called Product Categories. On each of the Product Categories, I have used Advanced Custom Fields to add fields such ...
0
votes
0answers
11 views

Getting a Post ID to show its content in a Popup

Im using a function to add a readmmore at the end of excerpts I dont want to link to a single-w.e.php Because I want to popup the page and the only way ive found to do this is to add the page to the ...
0
votes
1answer
10 views

How to list posts by terms

I have a custom post type with custom taxonomy and 3 differents terms. I'm trying to build a page with this structure : Term 1 Post tagged with term 1 Post tagged with term 1 Term 2 Post tagged ...
0
votes
1answer
15 views

Category permalinks don't work even after flushing

I have created a custom post type (portfolio) and I'm using the built-in Category taxonomy with it. When I view the category archives page, only regular posts are showing under the category, my custom ...
0
votes
0answers
63 views

Query posts by current ACF meta key value on single page as related posts

I would like to Query a custom post by the current ACF Meta Key values on a single custom post type page. I currently have a CPT called "news", a single-news.php page and ACF checkbox ...
0
votes
1answer
16 views

Empty taxonomy items for CPT in admin grid

In admin grid for post taxonomy, if I'll click on "Items" link, I'll get all post, associated with this taxonomy /wp-admin/edit.php?category_name=test. But this won't work for taxonomy for ...
0
votes
0answers
11 views

Set a numeric range for post ID generation based on post type?

I'm wondering if there's any way to configure WordPress to assign post IDs like so: Pages ID range: 10000 to 19999 Posts ID range: 20000 to 29999 Custom post type 'A' ID range: 30000 - 39999 Custom ...
0
votes
1answer
22 views

$post->post_meta not pulling any post in wordpress/php

I have a function in php as shown below: function hello_world( $post ) { echo '<pre>'; print_r($post); echo '</pre>'; // Line A echo '<pre>'; print_r($post->post_meta); ...
0
votes
1answer
15 views

Custom post type specific item design

I have a custom post type (benefits). Which as post name (bronze, silver, gold, diamond). All are listed in the same page template page-benefits.php. I want to display all on the same page but want ...
1
vote
2answers
122 views

Redirect Single Post CPT (Custom Post Type) to a specific URL

I have a domain domain.com and subdomain materials.domain.com At the domain.com scope, I created a custom post type called resources and a portfolio grid (using Elementor) to display it's featured ...
0
votes
1answer
44 views

Pagination Not Working for Custom Taxonomy with Custom Query - 404 Error

I am having trouble getting pagination working for custom taxonomy archive with the custom query. The pagination on the taxonomy archive ends up with a 404 page. I have to run a query multiple times ...
-2
votes
0answers
41 views

custom post-type not pulling posts in wordpress [duplicate]

I have a function in php as shown below in which I want to pull posts in wordpress with the post_type hello-world. function area_search( $abc ) { if ( $abc ) { $query = new \...
1
vote
0answers
17 views

Only view/edit/delete CPT made by users with the same role

I have created a custom post type (CPT) called "books" where users will be able to exchange "bookid" and "bookinfo" (as ACF). I have created user roles such as Countries ...
0
votes
1answer
57 views

How to output custom post type title on custom page with category next to it?

I have a website for an organisation, and I created a new page for the leadership team. I ran a query, looking for the "member"-type that have the category of "Leadership". So far, ...
1
vote
0answers
11 views

Cluster CPT posts to users based on ACF value from their profile on dashboard

I have added an ACF in each user profile which contain a list of cities. Each user select a city he is in The goal would be that only people from the same city will be able to access the same posts ...
1
vote
1answer
31 views

How to get the parent of a non-hierarchical custom post type being edited in Gutenberg

It's a common practice to use the post_parent property in the WP_Post class to create 1-to-n relationships between different custom post types. In an plugin I'm developing, I added a SelectControl to ...
0
votes
0answers
61 views

Limiting the Number of User Posts to Their Own Posts

I have set users to only see their own posts. But the total number of articles is still visible. Can we limit it to its own number of articles? How can it be done without plugins? related picture here:...
0
votes
0answers
38 views

Save the post parent in a custom post type in Gutenberg

A plugin I'm developing registers two custom post types: Class and Student. Both are connected via the post_parent property in the Student post type (one student belongs to one class). I added a ...
0
votes
0answers
15 views

Adding a column with multiple checkboxes to quick_edit_custom_box

sorry for my really long question. I have custom post-type called wp-music. This CPT holds a track title, song artist(s) and a few other columns. I wish to add this list of artists to the Quick Edit ...
0
votes
2answers
37 views

How to show my post type TEAM in dynamic way?

Hi everyone, I am starting now to develoo my first wordpress Theme and please, I need your help with code. With this code I created my post type Team, the problem is to show them, I do not know how to ...
0
votes
1answer
31 views

Custom permalink structure for custom post types including multiple taxonomy

The goal is to have a structure like this: example.com/tax_1/tax_2/post_name This code produces the right structure but the post can't be found (404) // Register custom post types function ...
-1
votes
0answers
16 views

How to use the following code on a WordPress site?

I have been trying to make a custom page for a custom post type to be displayed for a logged in user. I stumbled across this article. I am relatively new to programming, can you please tell me how to ...
0
votes
0answers
14 views

ACF relationship field group by taxonomy

How i can use ACF relationship filed to show output group by taxonomies. For example: I have post type "courses" with taxonomies "Undergraduate" & "Postgraduate". If ...
0
votes
0answers
38 views

How can I assign multiple parents to CPT?

I have created cpt called product-1, this product qualifies for 2 categories "paints" and "coatings", however I can only select 1 parent for the post. What would be the best way to ...
0
votes
1answer
15 views

How to get rewrited name of cusom taxonomy?

I have registered custom post taxonomy with rewrited name: register_taxonomy('behold_gallery-albums-subject', 'behold_gallery',array( 'hierarchical' => true, 'labels' ...
1
vote
1answer
65 views

How to add post_type=value when editing that post type in the Wordpress admin?

So basically in The Wordpress Admin when you are editing a "post" you have a url slug like... post.php?post=829&action=edit&classic-editor I would like to know, is there a filter or ...
0
votes
1answer
19 views

Button per line in Custom Post Types

Since several hours ago I am trying to solve this issue but I don't know what I am doing wrong in the code. I have a Custom Post Type with several records, then I wrote a php script to show the ...
1
vote
1answer
27 views

How to search for many post types?

I actually wanted to reply to another post, unfortunately that is no longer possible. Therefore a short and crisp question. ;-) If I want to search in several post types, can I simply work with '...
0
votes
0answers
18 views

Display the full content of a post in the search result page

For my website, I want the users to search for their pdf reports (using their report ID, which will be the same as the name of the file), i.e., the user has to enter the exact report ID to get their ...
0
votes
0answers
16 views

How to display the full content of a post in the search result page?

For my website, I want the users to search for their pdf reports (using their report ID, which will be the same as the name of the file), i.e., the user has to enter the exact report ID to get their ...
0
votes
1answer
37 views

Set parent for custom post type archive rewrite url

I have 2 custom post types Offices register_post_type('offices', [ 'labels' => [ 'name' => __( 'Offices' ), 'singular_name' => __( '...
0
votes
1answer
36 views

WordPress custom API endpoint - how to make the request more flexible

I'm creating simple API endpoint to fetch custom post type items with specified category and tags. function my_awesome_func( $data ) { $posts = get_posts( array( 'post_type' => 'faq', ...
0
votes
0answers
37 views

Custom query using one category that is used in all custom post types

I need some help from someone who can look at the code template below and see what I apparently still have wrong. I've been working on getting a template setup for a site that is using TwentyTwelve as ...
0
votes
0answers
16 views

How can I use javascript in specific posts without relying on a plugin?

I have a few posts needing javascript, but I can't rely on plugins. I know it can be achieved through functions.php, but there's another problem: I don't want the code to be loaded on every page. I ...
0
votes
1answer
28 views

Values from meta-box not on $_POST

I have a meta-box for a cpt and can't get the values from the form to update_post_meta cpt declaration: function hgod_fichas() { $labels = array( … ); $args = array( ...
0
votes
1answer
28 views

How to limit the number of custom posts certain users can publish in Wordpress using php script?

Background: I tried both https://wordpress.org/plugins/bainternet-posts-creation-limits and https://wordpress.org/plugins/limit-posts/, but they didn't work for some reason with my custom posts. So I ...
0
votes
0answers
20 views

Aloha! VERY broad CPT questions. Looking for the theory/best practices behind it

Aloha, I'm new to CPTs and fear that Iʻm making too many. I have 8 Research Areas - Should they be a CPT? Each Research Area will have 5 "types" of data - Should these be separate CPTs? I ...
0
votes
0answers
10 views

Exclude custom post type from list with Timber (TWIG)

I use Timber (TWIG) with WordPress (for the context). I created 4 custom post types : curriculum-vitae, dissertation, subject-imposed, subject-free But I would like to exclude two custom post types ...
0
votes
1answer
26 views

Change archive page template using pre_get_post

I've used pre_get_post to modify and display my custom post type in an archive page with pagination which uses my custom created archive template, see here. It it displaying the posts exactly what I ...
0
votes
0answers
10 views

Custom field for a faq system with loop

I created a system to manage a faq contents with custom post field ( i have userd ACF and CPT UI wordpress plugins ) to see in every pages definite contents that i decleared in each one if cycle. My ...
0
votes
0answers
23 views

Changing CPT permalink

I have a CPT named rad. I have the following code to change the permalink from "site.com/rad/post" to "site.com/category/subcategory/post". function remove_cpt_slug( $post_link, $...
1
vote
0answers
28 views

Use same slug base for Custom Post Type posts, and multiple taxonomy terms

I have done a lot of digging the past few days, and can come close, but not exactly what I need. I'm trying to alter a custom taxonomy/CPT permalink structure to all use the same slug base: /resources/...
0
votes
1answer
42 views

How to rewrite the beginning and end of the permalink structure in a custom post type?

I've created a custom post type called "dvposts" and cannot get the permalink structure to display exactly as I want. My regular post/page structure is /%postname%/%post_id%/. I would like ...
0
votes
0answers
20 views

Custom page with no headers, footers and its own CSS, Javascript

I want to create a custom page that uses custom css and custom javascript, what I want is to be able to add this custom html page to my posts, so I have everything ornanized. And I want this post to ...
0
votes
0answers
21 views

Next Previous link in Custom Post types only within same Taxonomy

I use a Genesis theme and Pods templates for custom post types. I have 4 CPTs for different types of Artwork. Within a given CPT I have a pods field to indicate whether the artwork is available or ...
0
votes
0answers
9 views

how can show specific category name and here child catagory name on wordpress custom post?

$args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'parent' => 0, ); $specialtys = get_terms( 'listing-category',$...
0
votes
0answers
9 views

Use custom header image on child page

I have created a theme for wordpress in which each page can be customized with a different header image. By default you set a custom image for the whole site, but depending on customization you can ...
0
votes
1answer
27 views

How get list of job types of simple job board plugin from code?

My code to get a list of jobpost is this, but in this list don't show job types $active_jobs = get_posts( array( 'post_type' => 'jobpost', ...
0
votes
0answers
15 views

How to show meta data like this in custom post type

How to add meta data entry like this in custom post type my custom post type name is fiction, review and galleries I am using CPT-onomy for custom post
0
votes
0answers
10 views

Dynamic template for single custom post

I am trying to create a dynamic template for all custom post types I create. I understand I can put the post type slug in "Template Post Type:" in the header comments of my template but how ...