Questions tagged [post-type]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
14 views

How to get all post status

I need to modify this code to show all post status, not just published. Any idea? $post_types = get_post_types(array('public'=>true),'names'); $post_type = !empty($_REQUEST['type']) && ...
1
vote
0answers
11 views

How do I set default meta value by post type?

I'm trying to set a meta variable depending on what custom post type is set but can't get my code to work. This is the function in the plugin that sets the metabox after the plugin has added it to ...
0
votes
2answers
18 views

Get all post types that supports tags

I'm trying to get all the post types that has tags functionality. I searched a lot but couldn't find a conditional or something for that. I need a way to get post types or post objects for the posts ...
0
votes
0answers
11 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 ...
2
votes
0answers
10 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 '...
0
votes
1answer
39 views

Twillio How To Send SMS for Custom Post Type

Twillio has a tutorial where one assembles a plugin that sends SMS notices when 'post' is published. The issue I face is many 'post' types are published a day and that would generate an annoying ...
0
votes
0answers
56 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 ...
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 ...
0
votes
1answer
75 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 ...
1
vote
0answers
62 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, ...
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 (...
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" ...
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?
-1
votes
1answer
28 views

How can I get the first post THIS SAME CATEGORY?

How can I get the first post THIS SAME CATEGORY? It's just that now he takes the very first post that is generally in this type, but it is necessary that he takes the first post in the same category ...
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 ...
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 ...
0
votes
1answer
39 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
1answer
38 views

custom post type single page not found after aotumatic publish By the author's robot

I use a plugin that has a custom post type and when I publish a post it is displayed on a single page but when the post is automatically published using a author's robot plugin, unfortunately the ...
1
vote
2answers
791 views

Disable block from editor based on post type

I've made a Gutenberg block which is only appropriate to show on hierarchical post types, so I want to disable it from the block inserter for non-hierarchical post types. I thought about how to ...
0
votes
0answers
29 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
0answers
15 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
58 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
96 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
31 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
157 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
1answer
44 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
63 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
21 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
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 ...
1
vote
1answer
25 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
3k 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
1k 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
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
2answers
29 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
231 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
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' ...
3
votes
2answers
288 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
83 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
113 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
24 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 ...
1
vote
1answer
2k 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
416 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
180 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
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
197 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 ...
2
votes
1answer
21 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
501 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
103 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 ...