Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

Delete custom post type in front end and redirect to specific page

I made it possible to delete the post from the front end with this code (get_delete_post_link redirect): <a class="button-iv" onclick="return confirm('are you sure...?');" href=&...
0
votes
0answers
14 views

Restrict admin pages for specific user role

I have created new user role "advertiser" and added some capabilities: function prefix_add_user_role() { add_role( 'advertiser', 'Advertiser', array( '...
-1
votes
0answers
5 views

Get all term IDs from by other taxonomy term

I have a custom post type "objects" that has two taxonomies: "portfolios" and "cities". I need a function where I can insert a cities taxonomy term id and get an array of ...
0
votes
1answer
9 views

Expire post to draft by date-picker custom field

Need to set post to draft when it reaches date from ACF date-picker field. This is code I'm using: // expire offer posts on date field. if (!wp_next_scheduled('expire_posts')){ wp_schedule_event(...
0
votes
0answers
6 views

Display 1 custom post type by a custom taxonomy not working

So the idea here is I have multiple products (CPT) and a custom taxonomy named Feature. It's a radio button field with Yes/No option. I want to display 1 random featured product on front page. But ...
0
votes
0answers
10 views

Display tags cloud of current taxonomy term in archive page

I am so sorry that I have no my own code for you because I am not good at php. I am trying to display tags ( with custom post count ) of current custom taxonomy term. It because I will display tags ...
0
votes
0answers
14 views

Newly published custom types show up in database but don't appear in the postmeta meta_value array

I inherited a Wordpress website with a custom post type, Business Types. I created a template page to display each business type (i.e. Construction, Lodging, Dining, etc.) as a heading with all the ...
0
votes
0answers
4 views

Any way to autogenerate a custom post with next 7 days of another custom post type in wp admin?

Currently, I have a custom post type of Event which uses WP_Query to get the next 7 days of events and places them into a carousel on the homepage. I am looking to further the functionality but ...
0
votes
0answers
9 views

Duplicate an elementor Post via API

I have a special context right here ! I'm using a java App to manage data. My main goal is to use the wordpress to display information, and use the app to work with data. What i'm trying to do right ...
0
votes
0answers
15 views

Check value which category a post belongs to

I'm doing a small project and I'm stuck and really hoping for your help. The problem is, I would like to have the user type in a code and the form do a double check, 1 if it exists as a value 2 which ...
0
votes
0answers
15 views

Edit the default 'post' custom post type arguments

I'm editing the default WordPress "post" custom post type, to add a "news" prefix before the single posts. I've used the register_post_type_args hook to add my args. It does work ...
0
votes
0answers
6 views

How to Add Different Default Featured Image for different Custom Post Types?

I've 3 different post types and want to set the default featured image for each post type. Thank you in advance.
0
votes
1answer
27 views

sort CPT on Custom Taxonomy Archive page

I have created a custom post type called "al_product" and attached to it a custom taxonomy called "product_category". In my archive-product_category.php I have this (relevant) code:...
0
votes
0answers
8 views

Custom Post Type with Custom Taxonomy and Permalink rewrite 404 issues

I am trying to set up a custom post type with a custom taxonomy applied with proper URL structure. What is working is website.local/demosite/products/technology/product-1/ this is showing correctly. ...
0
votes
0answers
19 views

404 page for post site with custom post type

I am stuck on a problem with a custom post type and own taxonomy. The archive pages are displayed correct. So: page.com/videotraining/ <- working page.com/videotraining/'cpt-title'/ <- working ...
0
votes
1answer
22 views

Create a CPT to edit Shortcodes Atts

I have create a carrousel and display it with shortcode and passed the image and text as attributes. However, the shortcode end up being to hard to read and edit when needed. Not user friendly. [...
0
votes
0answers
26 views

How to let user “register” to a custom post type?

I have made a custom post type for events and stuff (dates) and now i want users of the website sign in/register on a post if they want to attend. With each post there is a limit of people and they ...
0
votes
0answers
20 views

Updating a custom post status after an expiry date rather than trashing it

I have set up a custom post type of featured products. Within that post type I have a custom date field for an expiry date. Currently when the date expires, the post gets moved to the Trash. I'm ...
0
votes
0answers
10 views

Prevent users from having front-end pages

Is there a way to stop users from having front-end pages? For example, for custom post-types I have options for: 'has_archive' => false, 'exclude_from_search' => ...
0
votes
0answers
12 views

get_the_excerpt doesn't work with default items but works with my customs post types

the excerpt function not work in my custom post template using Wordpress default posts in the query loop, but they work fine with custom post type. I enabled the display of excerpt by checking the &...
0
votes
0answers
10 views

Order post grid by custom (acf) field - still not working

I want to order (sort) my posts in elementor post grid by an (acf) custom field "fakedatum" (see img sjh-1.jpg). I put some code in 'code snipped pro' (not in 'functions.php'): add_action( '...
0
votes
1answer
28 views

Display custom post types in dropdown with option “all”

wp_dropdown_categories() function has an argument show_option_all to search in all terms if selected. I need something similar in my custom post type select: <form method="GET" action=&...
0
votes
0answers
17 views

Custom post using elementor not displaying correctly

Sitting with a weird one, I'm currently busy rebuilding a site on Elementor. The site uses custom post types, I copied over CPT code to the functions file, created the archive template, and assigned ...
0
votes
0answers
6 views

Custom post type on two pages with different taxonomies but not use the CPT slug

Looking for some advice... I want to have two pages that list posts based around one custom post type (archive-false). For this example I’ve called the CPT: trains. The two pages are called electric ...
0
votes
1answer
23 views

WP_Query: how to search tags in addition to a custom post type?

Below is what I have so far for a custom rest endpoint ('placesdb/v1/search?term=') for a custom post type (place). This successfully returns all the places that have the search term in the title or ...
1
vote
1answer
120 views

React post to WordPress custom post type

I am not sure if this is the right way to do it but I have a react site using WordPress API as the backend. I want to store my contact form entries in WordPress so I created a custom post type ...
0
votes
0answers
19 views

Post template with breadcrumb needs to show page navigated from

I have a custom post type, Reports, that contains many categories (custom taxonomies). These posts are organised in menus on different pages. So a menu page named "Best Reports" would have ...
0
votes
1answer
10 views

display post count in archive page that have relation with another taxonomy term

This topic has been ask in Stackexchange many times. But most of question unanswered or has incomplete answer. My custom post type "Product" and two different taxonomy "Sectors" ...
0
votes
2answers
36 views

How can I sort the results of a REST API response by the title of a connected custom post type?

I'm using the rest_photo_query filter to manipulate the arguments of WP_Query through the use of my own GET parameters. It's working perfectly and fast, with one exception. I can adjust the orderby ...
0
votes
0answers
19 views

Wordpress URL rewrites using Advanced Custom Field

I've been working on this for a couple of days now. There have been many similar solutions here on this site, but none of them have worked out for me, or they nearly do, but then something else breaks....
0
votes
1answer
18 views

Wordpress Custom Post Type - Rewrite Query

So I have a project I am currently working on, where I have a Wordpress set to a permalink structure of /blog/%postname% for blog posts and pages are domain.com/page-slug/ I have created a custom post ...
1
vote
1answer
34 views

2 Templates 1 custom post type according url

Let's say i have a custom post type names "Projects", is it possible to have two template like : Minimal template (with a few info about the projet) Complete template (all the info) And ...
0
votes
0answers
14 views

How to display custom post type taxonomy in Contact Form 7 text field

I am developing a travel website but I am going to create a simple custom post type since the website will not have a complex feature for now. In this regard, is there any way to fetch/display where ...
0
votes
0answers
22 views

how to retrieve related projects in a post but via a custom taxonomy?

I have a site where for each solution there are case stories, the solutions are taxonomies so it is as if the case stories were articles and the solutions categories, by viewing a solution I see the ...
0
votes
0answers
8 views

How do I set/save a custom taxonomy term selected in a custom field (select element) to the post?

I'm a bit out of my element and feeling very stuck on something that seems like it's really obvious. Basically, my question boils down to me not being able to "save" custom taxonomy terms ...
0
votes
1answer
23 views

Custom post type data not displaying If I select the category from the dropdonw

I have created a custom post type. I am able to add all the details and it's working. I have a dropdown and I am getting my category in that dropdown. Once the user selects the category from the ...
1
vote
0answers
15 views

Querying Two Custom Post Types with OR Not Working

I'm trying to query two custom post types - I want all research_article to return, but only events that are in the future. My events are working as expected, but I'm not getting any research_article ...
1
vote
0answers
16 views

Wordpress multiple custom post types capability conflict in a single menu

I have been trying really hard to find an answer to resolve a issue I am having but not successfull so far. So If there is a solution exist, Please just give me the link / reference to it. Let me ...
0
votes
0answers
13 views

WP Plugin for product RFQ (with both listed and unlisted product ability)

I'm upgrading my old WP website from having static product attribute/variants tables and a basic contact form (which has served me well last 5 years), to a more interactive RFQ (Request For Quote) ...
0
votes
1answer
29 views

Add html tot CPT edit screen - no metabox

Which hooks can I use to add my own HTML stuff to a CPT edit screen? I created an own CPT with $args = array ( 'labels' => array ( 'name' => 'Catalog', ), '...
0
votes
0answers
11 views

How to disable wordpress themes and redirect users to login

I want to use my custom vuejs front-end app to display a custom post type using the REST api. I've created a folder named app inside the public folder of my vue project, inside it there is the ...
0
votes
0answers
20 views

Doing add_rewrite_rule only for specific post type

so I have these two rules for projects CPT. function addMyRules(){ // variables add_rewrite_tag('%eventid%','([^&]+)'); add_rewrite_tag('%version%','([^&]+)'); // release-...
0
votes
0answers
20 views

AJAX Load More Posts not working in my custom WordPress theme. Help!

I have been working on my custom theme since last week. I am trying to code kind of an eCommerce solution. Well, I registered custom-post-type called 'product' and was coding archive-product.php. I ...
0
votes
0answers
22 views

Disable Wordpress URL by ID number

I have a post URL like this: https://domain.com/cpt/post-item/ which has a post_id: 1234. But if I change the URL to this: https://domain.com/cpt/1234/ or this https://domain.com/cpt/?p=1234 or this ...
0
votes
1answer
44 views

How to add a default predefined thumbnail when creating a brand new post?

I'm making a plugin that has a custom post type and I need to add predefined content. I used filters default_title and default_content for the title and content but I can't find how I can add an ...
0
votes
0answers
25 views

Custom Post Type with Sequence ID

I am looking for a way in WordPress custom post type (portfolio) to manage the content of each category with a specific ID sequence. With the "Custom Post Type Permalinks" plugin, I can ...
0
votes
0answers
15 views

Delete associated featured image and pdf in media folder when a custom post type moved to Trash

here is a code to delete the featured image of a custom post type when moved to Trash. This works. Now I also want to delete a PDF associated to this post. Have a look, I am still doing something ...
0
votes
1answer
7 views

Unable to display selected post title in frontend from metabox wp_dropdown_pages()

I created a metabox in admin using wp_dropdown_pages() to display the list of posts from my custom post type workshop. The metabox dropdown works fine in admin, I can select the post title and save it....
0
votes
0answers
49 views

Custom query filter for Custom Post Type that is a registered taxonomy related to the current post

I need your help! I need to code a custom query filter to fetch posts from a Custom Post Type that is a registered taxonomy related to the current post (which is a diferent Custom Post Type). Relevant ...
1
vote
0answers
19 views

URLs for child terms

In my taxonomy I have a child taxonomy, but when I click into that, the URL changes and doesn't show the custom post type products. so this is what I'm getting directorytemp.test/business_category/...

1
2 3 4 5
196