Questions tagged [post-type]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Add directory slug to the post (but not custom post type) permalink structure [duplicate]

I'm having an issue trying to set up the default posts post type to use the permalink structure of /news/%postname%/ - I've tried editing the permalinks but it throws out my other custom post types. ...
1
vote
1answer
18 views

How to restrict wordpress search to pages and disable products listing search?

I have a requirement where i need to restrict wordpress search to pages listing only and disable products listing . In other words i wanted to replace post type in the search url from 'products' to '...
0
votes
1answer
11 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
1answer
15 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
13 views

How to get all CPT names into WP_Query 'post_type' parameter?

hello I want to display post based on his ID. This post could be a default 'post', 'page' or other registered custom post type. In query I sould specify all CPT names which I want to use, for eg. '...
0
votes
0answers
18 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
19 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
37 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
2answers
20 views

multible shortcodes (for differnt values) with one function

I am trying to create a function whicht has different shortcodes as output. I have the post-type => womos and the field => personenzahl. The field has the values 1 up to 7. Now I need a shortcode for ...
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 ...
1
vote
1answer
17 views

View the number of entries recorded per day

I want to display a chart of the number of articles published from a post_type within a specified time period (e.g. 30 days). Example : 1/1/2019 (1) 1/2/2019 (15) 1/3/2019 (0) 1/4/2019 (6) 1/5/2019 (0)...
0
votes
1answer
362 views

get_the_post_thumbnail_url('full') returns empty from custom post type

I'm trying to display the full size image of the single post from a custom post type that I created, below is what I've tried <?php $args = array( 'post_type' => 'press', 'order' ...
0
votes
1answer
281 views

How to get Post Type from the functions.php file

TLDR: How can I get the post type within the functions.php file? I am trying to add the following code only when the post type is a 'page' and not when it is a 'post.' However, I am not able to call ...
0
votes
0answers
25 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
74 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
2answers
18 views

How do you determine if a result in a search query is a post or a page?

I thought this question would be an easy find on the internet… however, it seems no one has ever ran into this issue before. There's no problem in listing a search query when you enter your search ...
0
votes
1answer
87 views

Display taxonomy loop using custom field data

Just learning PHP. Wondering what I'm doing wrong here. The aim is: if custom field in taxonomy term (in "shows" taxonomy) has data, show posts loop of taxonomy term in a custom post type ("blogs"). ...
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' ...
3
votes
2answers
116 views

What is the difference between “post” and “page” in WordPress?

I understood that both post and page are coming under the same post-type but I noticed that both are showing the almost same layout and behavior. could anyone explain in short words? Advance Thanks
0
votes
2answers
81 views

determine whether content is of type Page or a Post and display accordingly

I'm looking for a way to open every/any link to a blog post in a lightbox/modal globally and without having to any extra classes or rel attribute to the link element. I know I can access this info ...
1
vote
1answer
112 views

How can I pick a single post from the latest 3?

I'm looking to display a single featured post from my latest 3 posts at random. I've managed to get it up and running picking any post at random just fine, but I want to filter it down to only the ...
0
votes
0answers
17 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
437 views

Undefined property: WP_Post_Type::$ID

Using the Query Monitor Plugin - I'm getting this Error Undefined property: WP_Post_Type::$ID for this function: public function add_form_modal() { $button_group = get_post_meta( ...
0
votes
2answers
171 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.
0
votes
1answer
68 views

Setup database structure with books, authors, languages etc. for publishing house [closed]

It was kind of hard to find a good title for my question. What I'm trying to do is setting up a homepage for a publishing company. The website should contain all of the companies books with ...
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
115 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 ...
1
vote
1answer
17 views

What is the meaning of the various post messages?

I'm confused about some of the messages that can appear on a post entry/edit screen in the admin area: $messages['post'] = array( 0 => '', // Unused. Messages start at index 1. 1 ...
0
votes
1answer
339 views

How to check if it's edit.php & post_type is set?

I wanted to use css codes on certain post type with certain post status so i'm looking for a correct conditionals to use. How can i detect this if it's edit.php & post_status = draft& ...
0
votes
1answer
74 views

Pass PHP through redirect and custom fields

I'm trying to construct an easy to use affiliate site, each post-type has a custom field where keywords can be entered per post. ( using advanced custom fields plugin ) Then in a template I call ...
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
82 views

How to hide specific post type from archive?

Assume there is a post type called profilepost that I wanna hide from all kinds of archive. (but not changing the post status to private) I tried to get all post ID that belongs to this post type. The ...
0
votes
1answer
96 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
1answer
293 views

Wordpress delete mysql rows with string

So I'm updating the code of an old wordpress plugin(never released), and I want the database to be "clean" before importing new data otherwise data will just add up and i want it clean before every ...
0
votes
1answer
38 views

Conditional based on post meta

I've got this bit of code in my functions.php : // Disable theme single views function fq_disable_single_cpt_views() { $queried_post_type = get_query_var('post_type'); $...
0
votes
0answers
237 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
228 views

Dynamic pages for linked categories and content

Not new to Stack Exchange (i.e., Stack Overflow), but new to WordPress. I want to understand the power of categories, posts, custom post types, and the ability to generate dynamic content using them. ...
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
65 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
3answers
69 views

Permanent Custom Post Type

How do I add a custom post type to what I'm assuming is a table in WP's underlying database. I.e. I don't want to have this loading on every page and I want to be able to use slug and post-type ...
1
vote
2answers
50 views

I don't arrive to do order_by title when i have a conditionnal year in a request

I have a problem with this request with get_posts,when I want to order by title with year, order by doesn't work but when I do it without year, the request works. $args = array( '...
0
votes
0answers
270 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
1answer
233 views

Querying for multiple post types in SQL

My site is using a plugin for displaying an archive widget. It only displays the 'post' post-type. I currently have three different post-types. Looking through the code I found: $where = ...
0
votes
2answers
1k views

How to set a default CPT template and create post attribute´s display rules?

I have registered a new post type and made a custom template to display it. According to WP´s latest support for CPT templates, all it takes to make it available for any given CPT is to place this ...
7
votes
1answer
2k views

What are custom_css and customize_changeset used for?

A fresh wordpress install has the following post types: Post (Post Type: 'post') Page (Post Type: 'page') Attachment (Post Type: 'attachment') Revision (Post Type: 'revision') Navigation Menu (Post ...
-1
votes
1answer
62 views

add post type pram to wp shortcode

hello i have this program (show posts with ajax paganition and ajax category filters) and its works fine what i want its add a pram that accept post type in shortcode because i need it to show posts ...
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
3answers
4k views

single-{post_type}.php not working

I registered a new post type called "events". The posts of this type do show up in the loop but i can't access the single-events.php when i click on a "event" post. Also I can't access the categories ...