What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

Filter by
Sorted by
Tagged with
1
vote
1answer
17 views

Custom post type - no layout section of Document tab, and no author choice

A portion of my website is used by another non-profit organization. In order to restrict them from editing/deleting at large, I created a custom post type for them, and added a user role to go with ...
0
votes
1answer
16 views

Create a post automatically if search result has zero results

I'm developing a site where people can search phone number(s), the most complex part is that i want to create a post automatically when someone search for a specific number if that phone number yield ...
0
votes
1answer
24 views

Custom post type query with taxonomy

I use this query to call posts from a custom-type post I setup apart $args = array( 'posts_per_page' => 5, 'order'=> 'DES', 'post_type' => 'custom-post' ); $myposts = get_posts( $args ); ...
0
votes
0answers
17 views

Create API's for custom-post types & custom queries using REST or Graphql

I want to create a cross-platform app using rest APIs for the website (zoetalentsolutions.com). The website is in WordPress and has custom post-types, fields & custom queries. This app will not ...
18
votes
7answers
24k views

Get terms by taxonomy AND post_type

I have 2 custom post types 'bookmarks' and 'snippets' and a shared taxonomy 'tag'. I can generate a list of all terms in the taxonomy with get_terms(), but I can't figure out how to limit the list to ...
0
votes
1answer
12 views

Trying to list years (for a filter) but not all years display

I did an ajax filter to filter posts per years, however the filter isn't showing all items. Years are displayed in DESC order, but not all years appear I don't understand.... <?php $terms_year = ...
0
votes
2answers
2k views

creating a custom post template

I want to customize my individual posts. I have an example of what I'm trying to achieve below. Would I make a custom post template for this? If so how would I do this? Or should I add to my single....
0
votes
1answer
822 views

Add/Remove current_page_parent class

I created some custom post types and custom taxonomies, if I'm on an archive page of the custom taxonomy, the Blog menu item is highlighted due to the current_page_parent class. Well this is obviously ...
17
votes
3answers
25k views

Add extra parameters after permalink?

How can I add extra parameters after a permalink, specifically if I'm using a custom post type? For example, let's say http://mysite/album/record-name was the permalink. How can I make http://mysite/...
0
votes
0answers
16 views

Custom Post Type not pulled in Zapier

I'm using a Booking plugin that creates a new post type "booking". I'm trying to set up a Zap but this post type is not being pulled in Zapier (Not showing under "Post Type" nor &...
0
votes
1answer
627 views

Limit taxonomy terms added to a custom post type

I've created a Custom Post Type and a Custom Taxonomy. In WP Admin, how can I limit amount of taxonomy terms that are added to the custom post type? I want to add no more than one tag into the post. ...
0
votes
0answers
15 views

Custom Post type content not displaying on single page

I have added a select dropdown on my custom post type in the admin panel. Basically that is a select dropdown which is displaying my another custom post type title. I used below code. $args = array( '...
0
votes
0answers
7 views

Poll / survey you can vote Unofficially THEN if want “officially” counted, Login… (SW /plugin/etc) [closed]

I need a poll / survey SW / plugin / etc that people can vote unofficially then if they want it "officially" counted have to login w/ name/email/phone or a partial "official" w/ FB ...
0
votes
1answer
521 views

Custom user role not working as expected

I've defined a custom user role in functions.php called "Dashboard Admin" with the capabilities defined below. The site has a number of custom post types- all with capability post- and I'd basically ...
0
votes
1answer
834 views

Is it possible to add custom business logic to a Custom Post Admin Edit Page?

I have a custom post type that has a few fields that accept amounts. Each amount is editable. I would like to display the total of these amounts in another non-editable field on the same Custom Post ...
0
votes
1answer
15 views

Only show posts with a specific term of an associated taxonomy in a custom post type archive

I have a custom post type "movie" with a taxonomy "period". The "period" taxonomy has two terms: "current" and "past". Is it possible to only show ...
-1
votes
0answers
9 views

How can I do metabox filtering?

I have a post type. I have a private domain within this post type. My special area is a date. I want to filter by post type and end date. How can I do that? Thank you in advance for your help.
0
votes
1answer
2k views

How to pass taxonomy terms to WP_Query along with $args?

I created a cpt and custom taxonomy associated with it. Lets say custom taxonomy name is Sports. I added terms to it - football, basketball. Now, i want to fetch post titles tagged under football ...
0
votes
1answer
1k views

Custom post type URL - filter by taxonomy

Created CPT = news uses default categories (IT and recruitment) I am struggling to view an archive of the posts based on their category mysite/news/ - shows all posts for that CPT whatever the ...
1
vote
3answers
360 views

How to use has_archive but disable feed per post type?

What is the best way to disable feeds per post type but keep has_archive enabled?
0
votes
0answers
8 views

Adding custom URL rewrite rule for custom post type slug

I have a theme which defined custom post types. This post type is having a listing page and a single item page for every item. The problem is I can't change the slug for the custom post type and for ...
1
vote
2answers
2k views

Set post to draft after set period based on post_modified date

I have a custom post type for the user profile page. My client wants all users to update their profile at least once a month, so we want their profile (custom post) to be automatically set to draft ...
6
votes
4answers
6k views

get all posts from a custom post type

I'm trying to get all posts from a particular custom post type using the following code: $auctions = get_posts(array('post_type' => 'auction')); print_r($auctions); echo '<select>'; foreach (...
0
votes
1answer
259 views

Ordering Post by Meta Key (Not Working)

So I've read all the stack exchange posts on this, and I feel like what I have, based on what I've read, should be working. I'm a little confused as to why it isn't. $args = array( 'post_type' =&...
0
votes
0answers
10 views

WordPress pagination problem on merged queries

I have merged queries in search.php with custom post types. This is my scenario when user search to "math", the main query is searching in the post title, post excerpt, and post content. Now ...
1
vote
1answer
1k views

Add custom column to post list table

I have a custom post type called Book and I want to add the publisher and book author custom columns in the edit page. I also want to fetch a specific value from each fields (I created two fields ...
6
votes
3answers
9k views

Setting Default Category for Custom Post Type Upon Autosave

I've been searching for a couple hours and consulted multiple posts, but I seem to get this to work. I have this weird bug where users cannot see their drafts of a custom post type if they don't ...
0
votes
0answers
19 views

How can I make rewrite rules for a custom post type?

I'm trying to create rewrite rule which will work this way: when user enters URL site.com/projects/projectname/cityname it should work as site.com/?projects=projectname&city=cityname, where: ...
0
votes
3answers
2k views

Custom fields not showing in custom post type

I'm putting together a basic landing page http://shurity.com/, and in trying to clean up my code, I wanted to replace some static content with dynamic content for the user. The element in question ...
0
votes
1answer
620 views

How to filter custom post data with AJAX?

I have build a custom post_type with "Resellers" in order to enter my personal reseller items. The "Resellers" post have taxonomies like "Countries" and "Departmens". I am running into a problem: ...
0
votes
0answers
11 views

Make “Out of Stock Threshold” filterable or customisable per product [closed]

We have a client who would like to have a different "Out of stock threshold" for some products. This is different from the "Low stock threshold" setting which just notifies the ...
0
votes
2answers
2k views

Make custom post type column sortable

My site has two custom types: Auction and Lot. Lots are connected to an Auction via the post_parent field. I added an Auction column to the Lots list in the admin area. function ...
2
votes
1answer
943 views

set and unset the custom field value

While showing all the posts together in admin panel, I have a custom column 'Featured Image'. And this column has a value YesOrNO. To set the column name : I have inside functions.php: function ...
3
votes
1answer
6k views

Why are posts from custom post type not displayed in “category” archive?

I've created multiple custom post types which should share "category". Creation is done like this: $args = array( 'label' => __('MyPostType', 'key'), 'description' ...
1
vote
1answer
12 views

WP All Import - Using Xpath to set a select value

I'm working on setting up an import using WP All Import, the idea is to update/add/remove posts within a custom post type which contain ACF fields. The CSV we are importing contains a column called &...
0
votes
2answers
19 views

REST filters only firing when I have a param set

I'm trying to use a REST filter to require a certain parameter is set. Using custom taxonomies and custom posts I've been able to make it so when I request /wp-json/wp/v2/car?visible_to=123 That the ...
0
votes
1answer
859 views

Displaying posts exclusively in their category (not parent)

I am using a custom post type to add/display PDF documents (posts) on my website. taxonomy - wpl_documents_category post type - post_documents All is working well. However, I want to display the posts ...
0
votes
2answers
1k views

How to disable Publish button on Edit post if post title exists

I want to ask a question: I have a source code, it only works for the post-new, but not edit post. So how to disable Publish button on Edit post if post title exists? add_action('wp_ajax_check-posts-...
0
votes
1answer
852 views

Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?

i'm making a photo gallery for a plastic surgery website, with before and after photos of patients. i made a custom post type /photo-gallery and a taxonomy /procedures, after reading this post i was ...
0
votes
1answer
25 views

Add two custom product type

Hello i'm trying to add two custom product types, if i only add one everything works fine but when i add the other custom i get a crtic error, what im doing worng, this is the code that im using ...
1
vote
3answers
7k views

Custom post type archive page pagination

I have set up an archive page for my custom post type reference, where I use a query to get all posts of type reference. This works, but when I try to paginate the result, it doesn't work. Right now, ...
0
votes
1answer
24 views

Include a custom status flag on WordPress blog post

I have a WordPress blog called "example.com " and I need to implement a flag on the post page (WP-admin backend) that shows that a product has sold out. Default status: unflagged Sold out ...
0
votes
0answers
24 views

Adding a Custom Post Type

I'm not sure if this is feasible or not, but I want to add a simple custom post type that does two(2) jobs: Has a comment section (the user can comment on an image) It has a rating system (basic 5 ...
0
votes
0answers
11 views

how to make my custom gallery work in wordpress

So am creating a custom theme in WordPress and looking to achieve this I was able to output my category but not too sure how to output the remaining information. As you can see from the image below ...
0
votes
1answer
1k views

Get post from Category by Priority

I want get 3 posts from event custom post type. But i want to do that by category priority. If "featured" category has 3 upcoming event then i want to show 3 posts from it, if "featured" category ...
4
votes
3answers
12k views

How to display only top level posts in loop via WP_Query?

How do I set my custom loop to only show top-level posts? I have a hierarchical custom post type and the archive page shows both the parent and child posts.
6
votes
4answers
6k views

Make featured image required

Is it possible to force user to set featured image on some types of posts. For example I've got custom post type mm_photo and I want to show some error message or somehow block user from publishing or ...
0
votes
1answer
26 views

Is it possible to have “two” sets of tags?

I have several Custom Category Taxonomies but what I am wondering is, if it's possible to have a second set of "tags"? I am using my tags for a very specific purpose (the naming of cities) ...
0
votes
0answers
10 views

Trigger code when a custom post is published

I want to send a notification when a custom post is published, by using this code I am able to send function cc_publish_wpse_263985( $postid ) { // check if post status is 'publish' if ( ...
0
votes
0answers
6 views

Need help with disabling comments

I want to use only reaction emoji and disable comments is it possible? If so how to do it?

1
2 3 4 5
191