Questions tagged [post-type]

The tag has no usage guidance.

54 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
928 views

Show all parents and children in custom post type in right order

I would like to show all posts from a custom post type on one page with the ordering exactly like in the backend. I get the right ordering with wp_list_pages, but of course without the content. ...
2
votes
0answers
8 views

How can I filter block registration based on post-type? (Block alignment settings)

I want to disable the .alignwide and .alignfull block alignment options (remove them from the editor UI) on the 'post' post-type only. I have tried using this block registration filter to modify the '...
1
vote
0answers
23 views

Limit amount of posts made within a custom taxonomy

Is there a way to limit the number of posts that can be created within a custom taxonomy? I have a custom post type called Preferred Agents and a custom taxonomy called Agent Location. I want to be ...
1
vote
0answers
58 views

How to retrieve more posts from a custom post type that are in the same category as the current post

The site I'm working on is using a plugin IssueM that created a custom post type called article, and has a custom taxonomy called issuem_issue_categories that has categories such as boat-profile, ...
1
vote
0answers
24 views

force permalink slug for page vs post_type slug parent

I have setup permalink for post_type "directory" with this slug domain.com/directory/company-name now when I try create page with domain.com/directory is detect as parent of post_type "directory" ...
1
vote
0answers
18 views

Incorrect post_type in url of taxonomy term

I have registered a custom post type oa_location with custom menu (using show_in_menu) and a taxonomy called oa_country. These two connected but because our CPT placed in a custom menu, there is a ...
1
vote
1answer
114 views

Filter post_type thumbnail in Search result

it's my first question on Stack network so let me know if something wrong in the use of this. I have a theme with these pieces of code: /** * Get the Featured image URL of a post * @global object $...
1
vote
0answers
2k views

Default 'post' post type archive slug?

I have a wordpress site, which has a front-page.php rendering a custom front page, so that this template will show no matter if WP admin settings is set to static page or show posts. The default ...
1
vote
1answer
193 views

How to define which register_post_status goes to which register_post_type?

New to registering post types but looking at samples, and the codex not helpful here. I am not understanding how the two of these relate? This is just bare bones so someone can explain (the parameter ...
1
vote
0answers
68 views

How to build a simple nav system of custom post type categories and its posts?

I've been searching the web for a long time now, but couldn't find a solid simple anwser to, what seems to be a basic question: I have to output a list of custom post type categories and the posts of ...
0
votes
0answers
10 views

How to restrict access of Elementor Elements Library on frontend?

I am working with Elementor for a theme and so far everything is fine. I have made some templates that can be found under the Templates menu. They have a post_type of elementor_library and I would ...
0
votes
0answers
37 views

How to enable Attachment post type in Gutenberg editor for blocks?

I would like to make the native Attachment posts to be accessible by various Gutenberg Blocks. (To appear & be selectable in dropdown menus, etc.) Is that possible? The nearest answer i found is ...
0
votes
1answer
19 views

How can I get the content of the current page in my loop while merging post-type

I made a loop which is loading post-type. But while it is loading basic post and post-type, it is not loading the main content of the page. I am searching for a way to load the current page content ...
0
votes
1answer
64 views

Quick Draft widget (dashboard.php) using custom post_type

I'm trying to amend the WP dashboard widget 'Quick Draft' to accept a custom post_type avada_portfolio (Avada Fusion Theme) but the page just hangs each submission test. There was a similar question ...
0
votes
0answers
23 views

Shortcode is not showing content when placed in editor (post_type = page)

I have created a shortcode, which I want to use in pages. When I place this shortcode in a page (post_type = 'page'), it does now display the content. But if I place the same shortcode in a post (...
0
votes
1answer
26 views

Custom query for certain post type OR another post type with a certain category

I want to display posts that are either EITHER Post Type A OR Post Type B but ONLY if they are also in CATEGORY 1 Is that at all posible? How do I built my custom query?
0
votes
0answers
30 views

Search in wordpress with keyword and meta key

I want to perform a search in wordpress custom post type like this : search a keyword that exists in the post content in a specific category and much a meta field called city. <form> <...
0
votes
0answers
10 views

echo a list of meta-keys used in specific Custom Field post type

I have a few different post types, and i need to create a filter list for each one. Ideally this would use the 'meta_key' => 'departing_from' created by the customer, So it would only show the ...
0
votes
1answer
38 views

Distinguish between page and post in function

I'm trying to apply some text to the "Featured Image" box. It works fine for a custom post type, but I can't get a specific piece of text appearing on pages rather than posts. add_filter( '...
0
votes
0answers
26 views

Make category required

I want to prevent a post from submitting if no category is chosen. I don't want them to be automatically in the default category but really force the user to choose a category. I found this question ...
0
votes
1answer
27 views

Filter by Post Type

I'm trying to figure out how to filter the posts returned by post type. I have a list of checkboxes of my different post types, and using that, I've gotten an array of the post types wanted; $...
0
votes
1answer
43 views

Custom slugs for Each Tab

I have a website for musicians information. The information is divided to few different subjects, using tabs - 'General', 'Songs', 'Albums' and 'Videos. <?php if($tab_story){?> <li role="...
0
votes
1answer
59 views

Custom post type single with custom URL structure

I have a function that rewrites the URL before post slug including a custom taxonomy function wpa_show_permalinks( $post_link, $post ){ if ( is_object( $post ) && $post->post_type == '...
0
votes
0answers
21 views

Permalink like example.com/taxonomy/post_type/postname

I would like permalink structures like this: example.com/%post_tag%/post_type/postname for posts example.com/%post_tag%/post_type for archive page of post_tag filtered with custom post type archive ...
0
votes
0answers
29 views

google index an Post type page I do not want

I created a Custom Post type for my client's site, and everything works fine. but, I found that google index an archive page that I do not want. here is the code of my Post Type: $...
0
votes
0answers
38 views

How to create custom post type selection to nav menu

I added a custom post type in my navigation menu. with this code register_post_type( 'post_type_name', array( 'exclude_from_search' => false, 'label' ...
0
votes
0answers
23 views

Load custom post template

I'm pretty new to Wordpress Theme-development, so this might be a beginners-question. I looked everywhere for an answer, but none seems to suit my situation. I have created a custom shop page which ...
0
votes
1answer
23 views

Is there default meta boxes types that handles types and sanitization?

I've been tasked with my first WordPress project. It's a project that involves custom plugin development. While looking over the documentation for adding custom post types I found the meta boxes ...
0
votes
0answers
184 views

How can I get the Post ID and Post Type within a Must Use Plugin?

I'm trying to get the Post ID and the Post Type inside of my MU Plugin; functions like: get_the_ID() and get_post_type() return false, instead of the desire values. I read that many functions are ...
0
votes
1answer
31 views

How to mix 2 kinds of post types

I've got a real estate website. How can I make a connection with property and a client which is an owner of the property? There will be a lot of properties, and sometimes 1 owner will have 2 or more ...
0
votes
1answer
167 views

Change Custom Post Type to Post + Category

I have a rather difficult problem, I have a news site and I used a custom template with custom post-types for each "category" and now I want to change the template, but I can not change the posts for ...
0
votes
0answers
279 views

Shortcode in excerpt

I've a custom post type " Calendarize it ". And i would like to show at the end of the exerpt the custom taxonomy "Price". The price can be display by using this shortcode : [rhc_term taxonomy="prix"]...
0
votes
1answer
32 views

How can i order my posts by post type?

i have a query post : $args3 = array( 'posts_per_page'=>20, 'post_type'=>array('num1','num2'), 's' => urldecode($command), 'orderby' => 'type', 'order' => 'ASC' ); ...
0
votes
1answer
121 views

post_type not working when tag__in is present?

I noticed that when I have the tag__in argument, the post_type one is ignored. Has anyone noticed this or knows a fix? `$args = array( 'post_type' => 'page', '...
0
votes
0answers
396 views

Custom post type post_type_link gives “page not found” on any other custom post type

I'm trying to edit an existing custom post type for the theme I'm using called "Divi". This custom post type is called a "project". Now I'm trying to change the default slug of: http://example.com/...
0
votes
0answers
21 views

Post types showing tables…Can I do that?

Hi everyone! I have the design of my web and there's a page that it should look like this. I don't know if this is the good way to do it but I'm trying to make custom types that show like "post", and ...
0
votes
1answer
35 views

custom post permalink

I want to make single custom post's permalink like this. website.com/cat-1/post-title-1 I have done with one way that is if I keep the post type name, then it shows okay as like this: website.com/...
0
votes
1answer
73 views

Adding featured image to post display widget

I have below plugin code that displays custom post types as a recent post widget. I would like this code to also display the summary excerpt of the posts and the featured image of the posts as well. ...
0
votes
1answer
853 views

How to set “manage categories” capabilities on a post type taxonomy but not on the general categories?

I want to set "manage_categories" capabilities on a post_type taxonomy but not on the general categories? I've added to register_taxonomy: 'manage_terms' => 'manage_categories', ...
0
votes
1answer
524 views

Get_posts not returning any posts when used with switch_to_blog

I'm attempting to pull in some order information from the "shop_order" post_type. This is on a multisite network, so I'm using switch_to_blog(1). When I set the post type as "post" it works great and ...
0
votes
0answers
173 views

do action inside a class is not working

I am trying to create my custom hook and call it from within a metabox class. Here is the pattern: metabox.php -- <?php require("libs.php"); require("test.php"); class metabox() { function ...
0
votes
1answer
75 views

Show post type taxonomy

I'm making a WordPress theme I've copied post-type codes from "AVENUE" theme by "FabThemes". Codes Are these: <?php /* Property Listings*/ function post_type_listings() { register_post_type( ...
0
votes
0answers
232 views

Updated from 3.8 to 4.2 and all post types changed to “post”

My client updated his website from WordPress 3.8.x to 4.2.1 in order to make a plugin verify as working correctly. We were holding off originally to do it and some other plugins all at once so we ...
0
votes
1answer
27 views

Issue attempting a wp_query_posts with tags

Having an issue trying to query the most recent posts using the tag, in this case, trending. I used the following code but I get no results. If I switch out 'tag' to 'post_type' it will work: <?...
0
votes
1answer
55 views

Taxonomy template by post type

I have 2 custom post types that share a taxonomy. The taxonomy template of my taxonomy ( taxonomy-my_tax.php ) will query both custom post types. Is there a way to have a taxonomy template for each ...
0
votes
0answers
219 views

How to show metabox key to custom post?

is it possible to show all custom metabox key name and show it as dropdown list on my custom post with my custom metabox dropwdown list ? this is custom metabox from another plugin/theme and how to ...
0
votes
1answer
20 views

Add a tag like a post

For days I'm looking at different threads Stackexchange, but I can not find the solution. I hope you can help me out. I created a post_type called "bands". I'm trying to, from another post_type (eg ...
0
votes
1answer
138 views

permalink and $_GET

i create a new post-type called servizi. I customize the permalink for this structure: /%post_id%/%postname%/ But there are a different width post link . For example the post link is www.mysite.it/...
0
votes
1answer
85 views

Problem with permalink structure for Wordpress custom post_type archive template

I have looked at other similar answers to this question but not finding my way. I am using Custom Post Types plugin for a custom post_type called 'product' and has_archive is set to 'true' in the ...
0
votes
1answer
4k views

Why does 'exclude_from_search' exclude a custom post type from WP_Query?

In WP 3.1, it appears that setting 'exclude_from_search' = TRUE for a custom post type excludes the post type not just from searches on the front-end, but also from any post query using 'post_type' = '...