2022 Developer Survey is open! Take survey.

Questions tagged [post-type]

The tag has no usage guidance.

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

Filter Media by attached page or blog post in Library

I am trying to create a filter using restrict_manage_posts that will filter all media according the page or post type that have been attached to. Actually i need to create a filter that refers to the ...
user avatar
0 votes
0 answers
18 views

How to hide list from custom post type

Is there any way to hide post list from custom post type that I have created. Your answer would be really help.
user avatar
0 votes
0 answers
21 views

Why is my custom post content only viewable when signed into Wordpress?

I've created a custom Post type called 'Data' to display content on a Wordpress site. The content works and is displayed if viewed when signed into Wordpress. Howevever, if you view the same URL when ...
user avatar
  • 1
0 votes
0 answers
23 views

How to change listing type permlink?

How to change the listing type permalink? I tried changing it from the admin dashboard permalink field but it’s not working. I am using MyListing theme, i tried to reach them but no response till now ...
user avatar
0 votes
1 answer
39 views

Target only single product page

At first sorry for my bad English! I try to hide #mceu_27-body and #wp-content-editor-tools on products page (editing mode) like on the pics for certains authors! This work find : add_action('...
user avatar
0 votes
0 answers
25 views

paginate_links appearing on page but it doesn't actually paginate - pagination on a static page with a dynamic `post_type` argument on a static page

I'm doing a custom post loop like this; <?php $args = array( 'post_type' => $resourcesPostTypes, 'post_status' => array('publish'), ...
user avatar
  • 113
0 votes
0 answers
29 views

Is it possible to set public to false for the native WordPress blog

I am using my WordPress posts to generate excerpts to go to an outside URL instead of the permalink. I know how to set a custom post type's: public => false but I don't know how to do this for the ...
user avatar
0 votes
0 answers
37 views

Error in Fetching Custom Post Type parent Category URL (slug)

I have this code for breadcrumbs that works fine except the custom post type parent category URL and the category TITLE. The parent category URL is does not return the valid (correct) slug while its ...
user avatar
0 votes
0 answers
18 views

How do I make the comment disappear after deleting from the database?

I can delete the comment from the database with this code, however when the page is loaded again the comment will still be there. I need to update again to disappear. How do I resolve this? ...
user avatar
0 votes
0 answers
28 views

Custom Post Type Single Page is not working

I wanted to know, why my single custom post type isn't working. Everytime I wanted to open the single post type it automatically gets back to the homepage. Please help! Here is my code: // Team im ...
user avatar
  • 1
0 votes
1 answer
32 views

Wordpress private post won't display to other admins

By default Wordpress private posts are visible to all admins right. But on this build for some reason private posts are only displaying (on the page) to the admin that created it. I'm perplexed. I ...
user avatar
0 votes
1 answer
37 views

Unique IDs for Post Types and Taxonomies

Sometimes I have duplicate IDs between Post Types and Taxonomies, I know this happens because they are stored in different tables but I wish it was possible to have a unique ID for each thing in WP, ...
user avatar
  • 117
0 votes
1 answer
35 views

Only show meta on one post type on search results page

I want to remove the post meta from all post types that are not "posts" from my site or at least from the search results. Im currently using the Jnews theme and in the search results page I ...
user avatar
1 vote
0 answers
14 views

Adding sections in the 'Pages' post type

I'm wondering if there is a way to add titles or nested groups to the pages post type. A website of ours have an enormous amount of pages so we want to order the pages in (preferably) groups/...
user avatar
4 votes
2 answers
329 views

How to get only posts, pages and custom post types in WordPress

I am trying to get Pages, Posts and Custom Post Types In WordPress website but it is showing some other things in the list. My Code: <?php $types = get_post_types( ['public' => true ], '...
user avatar
0 votes
1 answer
45 views

How to loop custom post_type from (a) specific category(ies)?

I'm using this code which works really fine to list quite everything I need as Featured image and title, from my custom posts "portfolio". <?php $args = array( 'posts_per_page' ...
user avatar
0 votes
1 answer
81 views

Local Post Date in Wordpress Admin Panel Tables

It seems that Wordpress does not save the post date in UnixTimeStamp in the database, and it comes up with the whole date and time format, as we can see in the image below. With this introduction in ...
user avatar
  • 113
1 vote
1 answer
61 views

How to display get_post_type() translated?

In my content-search.php template file I did something like this: <tr id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <td><?php the_post_thumbnail( '...
user avatar
  • 144
0 votes
1 answer
98 views

Remove taxonomies using register_post_type_args

The theme I'm using is adding taxonomies to CPT using register_post_type and 'taxonomies' => array('portfolio-cat') as one of the arguments. I need to remove that particular taxonomy using ...
user avatar
  • 147
0 votes
1 answer
178 views

Custom post type and standard post not displaying or working

I want to display 5 images of custom post type 'project' and 1 standard post in the front-page. I have tried to merge both queries in one, however its not working. FYI: I have set the theme support ...
user avatar
  • 125
0 votes
1 answer
41 views

post_type internal ID?

This may sound like a stupid question, but is there something like an ID associated with the post types (built in or custom) in WordPress? I'm not interested in the actual post id, but wondering if ...
user avatar
  • 3
0 votes
1 answer
22 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']) && ...
user avatar
  • 101
1 vote
0 answers
21 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 ...
user avatar
0 votes
2 answers
29 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 ...
user avatar
2 votes
0 answers
30 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 '...
user avatar
0 votes
1 answer
89 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 ...
user avatar
0 votes
1 answer
22 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 ...
user avatar
  • 101
1 vote
0 answers
30 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 ...
user avatar
0 votes
1 answer
229 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 ...
user avatar
1 vote
0 answers
101 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, ...
user avatar
  • 11
0 votes
0 answers
27 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 (...
user avatar
1 vote
0 answers
30 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" ...
user avatar
  • 11
0 votes
1 answer
27 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?
user avatar
-1 votes
1 answer
33 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 ...
user avatar
  • 1
1 vote
0 answers
20 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 ...
user avatar
0 votes
1 answer
53 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( '...
user avatar
  • 314
0 votes
1 answer
61 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 ...
user avatar
  • 1
3 votes
3 answers
3k 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 ...
user avatar
  • 615
0 votes
0 answers
16 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. ...
user avatar
1 vote
1 answer
123 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 '...
user avatar
0 votes
1 answer
217 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 ...
user avatar
0 votes
1 answer
43 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; $...
user avatar
0 votes
1 answer
342 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. '...
user avatar
  • 141
0 votes
1 answer
132 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="...
user avatar
0 votes
1 answer
210 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 == '...
user avatar
0 votes
2 answers
24 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 ...
user avatar
  • 5
0 votes
0 answers
25 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 ...
user avatar
1 vote
1 answer
74 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)...
user avatar
0 votes
1 answer
10k 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' ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar

1
2 3 4 5