Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-post-types]

Custom Post Types extend the WordPress back-end to support additional, non-Post content.

0
votes
1answer
7 views

Using Wordpress custom post type to display StoryMapJS

So I want to use StoryMapJs on my website, and I want to be able to manage these via a custom post type. I've created a custom post type and fields for each option, but I'm struggling to get them to ...
0
votes
1answer
15 views

Validate custom fields before save using WordPress Rest API

I want to add custom validation to post(custom post type) before it save into the WordPress. I am using the Rest API to insert the post to custom post type. What I need is the fields which I created ...
0
votes
2answers
26 views

How to use wp_mail in CPT page

I have a CPT and inside the CPT I have a contact form. The contact form directly sends to WordPress dashboard, Now I'm trying to implement when a user submits the contact form they will receive a "...
0
votes
1answer
13 views

Custom post types - meta_query: search lesson which starts sooner

I have lesson custom post types which have 4 date sub fields (among others): period_a_start, period_b_start, period_c_start, period_d_start. I want to create a query to get the 8 first lessons that ...
0
votes
0answers
16 views

Pretty Permalinks with CTP and Taxonomies / Hierarchical

My Site has 2 Custom Post Types with a 2 Taxonomies. One taxonomy is “Location” which is 2 level / hierarchical (Country, City). My goal is to get our Post Types & Taxonomies in a SEO Pretty ...
0
votes
0answers
12 views

How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?

I want to use Categories and Tags everywhere in WP (Articles, Pages, Attachments and CPT like for example Jetpack-Portfolio) I have been able to show these 2 core taxonomies (category and post_tag) ...
1
vote
0answers
21 views

How to add button to post page WordPress 5.x

How can I add a button to a posts page? what hook can be used to add a custom button I'd like to place it next to, or near, the "Publish/update" button, or modify the publish button for triggering ...
0
votes
0answers
14 views

My pagination is not working properly and on click it does not change its URL like page/2

<?php /* Template Name: Custom Identifier */ ?> <style type="text/css"> h1{ font-size: 30px !important; } .my-content{ width:100%; margin-left:5%; padding: 10px; box-shadow:0 0 ...
0
votes
0answers
9 views

Shortcode of Custom Post Type Metabox Array

I have an Custom Post Type which dynamically creates 2 textboxes, one for date and one for description. In my single-template I use the following code, which functions perfect. But when I use it in a ...
0
votes
2answers
29 views

Query a custom taxonomy in a function to create an csv file

I a problem with getting the query for custom taxonomy to work in this function. The $filter is filled with data but the get_posts() does not use it? The query works without the tax_query and there ...
0
votes
0answers
14 views

Generate post content from meta fields

I have a custom post type (match). Each posts on this CPT has one ore more custom fields. Is it possible to automatic generate the 'post content' with the value of my custom fields on these posts? ...
0
votes
0answers
14 views

How to mass align content (text + photo's) of all posts at once?

On my old-Bloggersite I had 190 posts with the content and pictures CENTERED. I imported these to my new, fresh WP-site. Can I now mass align all posts-content at once to THE LEFT? (text+photo's). It ...
1
vote
1answer
9 views

Show listings from Impress Listing plugin in random order using taxonomy and terms

I am not able to get the listings to show up. I have verified the slug for the post type and the taxonomy. This code I know works because I have used it for other post types and taxonomy's. Any ...
0
votes
0answers
6 views

Custom post type gallery + dropdown category menu and “download all images” link

I'm trying to create a simple content post type in which the user can upload images and add custom categories. I've done the first two (the post type and the custom categories in the functions.php) ...
1
vote
0answers
16 views

Custom Post Type not showing in Rest API on Multisite

I'm using WP Multisite and can't seem to pull through my custom post types via the API. <?php function terms_post_type() { $labels = array( 'name' => _x( 'Policies', '...
0
votes
1answer
25 views

Saving custom post types post_meta over REST-API fails

I try to save with wp-json my custom post types meta data but does not works in my case I create my custom post type with jjgrainger's class as it follows $arguments = array( 'public' ...
0
votes
0answers
8 views

How to refresh Parent Term List after creating a new category

I want to repopulate parent terms drop down once a new category is created. At least refreshing the current page is enough. I tried to hook into "create_category" hook also. I'm using custom post ...
1
vote
2answers
17 views

Change Featured Image / Thumbnail CMS Description

I'd like to be able to edit the description/help text that appears beneath the field in the CMS page editor for a custom post type. I know I can change the name and button/link text by passing items ...
0
votes
0answers
39 views

Query with multiple CPT but custom field for only one on them

I need the query with merge of two CPT posts (for example cpt1 & cpt2). The problem is when is need to add the 'variable' only for one CPT, that is the a custom field and relevant value (for ...
0
votes
0answers
21 views

Wordpress Post IDs are not incrementing when Add New

I have a dev site and a production site and this is only a problem on production. This happens whenever a new post or custom post type is created from the "Add New" button. If they are created ...
0
votes
1answer
13 views

Sql Update CPT from publish to draft and particular custom field

I have: CPT: match custom field: played Is it possible by MySql to change the status from publish to draft of all posts of CPT 'match' with custom field set as '0'? A good start can be UPDATE ...
0
votes
1answer
25 views

multiple custom post type on category page

Is it possible to have multiple custom post types appear on a category page? For example, I have a category Animals and I can assign it to both these custom post types: dog, cat Both cpts use a ...
0
votes
0answers
20 views

How to properly get the wp_postmeta.meta_value of a custom post type in specifics?

In a RDMS with the following query I try to get postmeta.meta_value of the post with custom post type points. To identify which key they belong to I made a case when. This query returns a greater ...
0
votes
2answers
28 views

How to automatic update date and time when save custom post type

I need to update date and time when I save posts. I see the code on the following thread, but I need to have this trick only for posts contained in my custom post 'new_cpt' Is it possible? ref: ...
0
votes
0answers
8 views

filter by Meta custom field in rest api defined by pods as realtion to categories

i installed PODS and create a new custom post type named locations and relate it to default Wordpress entity : category when i call mydomain.com/wp-json/wp/v2/locations?fields=id,category rest ...
0
votes
0answers
16 views

template id=“1921” from inside editor doesnt work?

I have inherited management of a WordPress based site. And suddenly something like this [template id="1921"] typed in the editor isn't working. Been looking in the DB and there are posts with a ...
0
votes
1answer
19 views

Adding orderby url parameter to main CPT admin menu link

Is it possible to change the main admin menu link for a CPT (the link to edit.php) to include URL parameters? I wan't to make the posts list default to sorting by "title" but I don't like how ...
0
votes
0answers
10 views

Wordpress - Complex Forms

We have a very complex form on our website which is being generated using Formidable Forms (Pro version). It has a lot of conditional logic being used, and is very heavy in scripting as well as ...
-1
votes
0answers
14 views

Get all custom post types associated with a user

I have created a custom post type called "Groups" where I can add a list of users to it. I am trying to write an API that will return all the groups associated with a particular user. I am storing an ...
0
votes
1answer
14 views

How to make password protected posts that will expire after they are used?

Is there a possible way to make password protected posts that will expire after they are used?
1
vote
2answers
20 views

Wordpress loop: Show only a Custom Post Type Taxononmy TERM

Before I start, I have to say that I have tried to solve my problem in a thousand different ways and I have read several posts without success. I have a CPT called "grouped", a taxonomy for that CPT ...
1
vote
1answer
43 views

How to replace custom post type slug with an ACF value?

I have a drop down select type field in Advanced Custom Fields. The values are Video and Image. I want to replace the Custom post type slug. Currently, it is video. I want to change mysite.com/...
1
vote
1answer
48 views

Side effects of Script and Iframe in post

I am writing a post on HTML. Afcorse the post will have Codes in it. So for showing results in the post, I am taking help of JSFiddle, by embedding results of the code. JSFiddle gives two methods for ...
0
votes
1answer
13 views

wp_set_post_terms not updating with WP Cron Event

I have a jobs board custom post type (job_listings) with a taxonomy (cvl_job_status) attached with various tags assigned, namely; Live, Filled and Expired. Each job post has a custom field (...
0
votes
0answers
22 views

Hide ROW in dashboard list based on specific condition? (temporary custom post type)

The picture below is a screenshot of pupils. I have duplicated one of these pupils. (Therefore two pupils with the same name). The difference lie within the name. I know I can add and remove columns ...
0
votes
0answers
23 views

I have made the custom post type but its single view is going to index

Here's my code: function create_posttype() { register_post_type( 'movies', // CPT Options array( 'public' => true, 'labels' => array( 'name' ...
0
votes
0answers
19 views

Get Post Primary Category

I have troubles with getting the posts primary set category. How should I achieve this? My code: global $post; $terms = get_the_terms( $post->ID, 'event-categories'); if($terms) { foreach( $...
0
votes
1answer
10 views

Add a comments meta box to the custom post type

I have created a custom post type called groups and I would like to add the comments meta field to this edit groups page. Any ideas that would help me? Thank you.
0
votes
0answers
19 views

add_rewrite_tag broke permalinks that doesn't use that specific tag

I have a custom post type that I'd like to have a permalink slug based on its taxonomy. All the posts of this CPT have one, and only one, term always marked on this specific taxonomy. That's my code: ...
0
votes
0answers
10 views

Custom post types & Pages hierarchy - Error 404

I've defined two custom post types: Theme Fiche I've also 7 pages using a defined rubrique template: (template-rubrique.php) Both my Theme and Fiche have an ACF post-object field. The Theme ACF ...
0
votes
0answers
28 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
20 views

Rewrite url for custom post type with specific url

I have a custom post types called Destinatiosn. These post on click opens as pages and they are organised hierarchically. Example: Malaga Food Gallery Rooms Marbella Food Gallery Rooms Now in ...
0
votes
0answers
23 views

Allow Editor to view/modify a custom post type

I created three new custom post types and they all work fine for my admin user. A User with the Editor role can see the menu items in the admin, but when they click one it says: "Sorry, you are not ...
0
votes
0answers
8 views

Toolset search categorize with a list

I am creating a toolset view and I want users to be able to list the categories of posts with links instead of radio buttons, checkboxes and the prebuilt within toolset views, can you do it with ...
0
votes
0answers
32 views

WordPress custom post type url change

I have two custom post types. Destinations - destination custom post type has their posts and they are organized in hierarchical mode example: Malaga Food Gallery Rooms Marbella Food Gallery ...
0
votes
2answers
29 views

News post with multiple permalinks? When opened from different page

I’ve got a question. Maybe it’s something existing and I don’t know the name. Or maybe it’s something custom. I’ve got a post type for news. The news posts have categories. These are some examples of ...
0
votes
0answers
21 views

Specific Sigle Template for regular category on custom post type

I have two different categories assigned to two different posts that belong to a custom post type. What I'm trying to do is display a different template for each of these categories. I already tried ...
0
votes
0answers
13 views

How to add a custom page as menu item “selection”?

Sorry for the confusing title; I do not know how to explain this in one question. I want to add a navigation item that can be added to menus. In other words, I want to write a function that will ...
1
vote
1answer
20 views

WP Meta query for a custom post type based on two values

I'm hoping you can help me out and give me a tip on something I'm trying to achieve and failing miserably. I'm working on a WordPress real-estate theme - Real homes. Here is the link to the website: ...
0
votes
0answers
17 views

Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop

I'm aware there are already answers regarding this question (Insert html after certain amount of posts?). But I haven't managed to find a solutions to my specific problem. The post linked above rely's ...