Questions tagged [post-type]

The tag has no usage guidance.

42 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
825 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. ...
1
vote
1answer
104 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
1k 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
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
1answer
14 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
0answers
17 views

Adding post_type filter on pre_get_posts gives 404

I have a basic WordPress query: $the_query = new WP_Query(array( 'post_type' => array('post'), 'posts_per_page' => -1, 'ignore_sticky_posts' => true )); But if I try ...
0
votes
0answers
15 views

Custom theme index layout not displayed correctly

I'm making a custom theme that I'm planning to sell. I'm reading some guides about themes creation, I have already experience with wordpress but this time I want to make a nice theme. I'm facing a ...
0
votes
1answer
18 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
36 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
19 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
11 views

Post type switch on front by post author

It's really nice to write first post here ;) Ok, let's get started. I have 2 custom post types - 'actual' and 'finished'. On 'single-actual' i want to have a link that when author post click then ...
0
votes
0answers
24 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
66 views

Query multiple Post Types that have the same Taxonomies with different Terms

I have a method that works. However, it's not very optimal and limits WP_Query's functionality (recently with pagination). I saw a similar question/issue, but the answer provided is the current ...
0
votes
0answers
31 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
16 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
21 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
110 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
91 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
230 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
28 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
59 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
260 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
20 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
34 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
31 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
606 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
370 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
159 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
73 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
226 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
25 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
50 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
1answer
184 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 ...
0
votes
0answers
208 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
137 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
80 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
9 views

How to add post type in masonry posts elementory widget

When I try to create a website using Wordpress 5.2.2. I found a widget called Masonry Posts in Elementor Panel. But when I added the widget and checked there is no option to choose the post type. We ...
0
votes
2answers
158 views

Woocommerce - custom post type of checkout page

Is it possible to set custom post type page as a checkout page in woocommerce? I can set only default pages, but I need different post type.
-1
votes
1answer
43 views

How do i retrive a post from a custom post type

How can i retrive a post from a Post Type were "distributie_seriale" is a relationship field. Ex: I add an Actor to PostType - actors ( Add post) next I add an Serial on PostType- serial ( Add ...
-1
votes
1answer
3k 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' = '...