Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

how to create hierachial taxonomy and manage under single post type?

i have created Farmers Post type for managing farmers data in wordpress. now i want to create hierarchical taxonomy as below: ->state ->district ->g.panchayat ->village ->farmers Please ...
user avatar
0 votes
1 answer
16 views

Auto Generate Post Title from 2 Custom Fields

I would like to generate the post title from 2 custom fields, 'job', which is a taxonomy, plus 'date' which is a date picker, not the date of the post. This is for a custom post type called 'job-...
user avatar
0 votes
0 answers
45 views

Why will comments not remain open on custom post types?

I have a WP install which makes use of default posts and of one custom post type (reviews). Discussion settings allow comments on both these post types. The comment form is present when viewing posts ...
user avatar
  • 29
0 votes
2 answers
24 views

Custom post type loop with custom category filtering

Can anyone help me here. I want to list all the custom posts with the type 'portfolio' in this loop, where they have the 'Project Categories' set to 'ABC'. The below doesn't work, I think the issue is ...
user avatar
  • 101
0 votes
0 answers
17 views

Filtering custom post pages

I am looking to create a system where I have a custom post type with a bunch pages therein. The custom post pages have a custom category system so I can add categories to each custom post. I the want ...
user avatar
  • 101
0 votes
0 answers
17 views

Publish box in CPT remove 'edit' link

Hello I have a custom post and in the Publish Box I would like to remove the timestamp edit link.
user avatar
0 votes
1 answer
17 views

Hide Published text from custom post types column

Is it possible to hide the 'Published' word only on custom post types column? as in image and just leave the date and time?
user avatar
0 votes
0 answers
11 views

Single Parent post having children's posts

I wanna create Custom Post which can have unlimited child posts. But problem is when I am on child post and I want to let child post know that there is another next child post of same parent. Here is ...
user avatar
0 votes
1 answer
21 views

Hide Status Option From WordPress Publish Metabox and Rename Published on:

I want to hide Status option on publishbox and rename Published on to Date Created for Custom post post_type like you see in red on the below picture.
user avatar
0 votes
0 answers
17 views

How to change CPT single post slug

I need to automatic change slug for all CPT posts. I want it written backwards. For example: Post title: My super post 1 Default post title slug: my-super-post-1 Post title slug after automatic ...
user avatar
  • 27
0 votes
1 answer
16 views

Check if user has comment on current post

Hello I have multiauthor website and I need to create a condition to check if defined user ( no current user ) has comment on current post. Here is my code but I can not complete this $userid = "...
user avatar
0 votes
1 answer
31 views

Fetching custom post type without knowing post type (REST API)

How can I fetch posts from a custom post type without actually including the post type in the query url? The data I'm provided doesn't have a reference to the post type, so all I get is the post ID. I'...
user avatar
0 votes
1 answer
14 views

How to Enable Ascending or Descending In WordPress Default Built-in Loop

Can someone please let me know how we can add Order functionality to WordPress Built-in Loop? <?php if (have_posts()) { while (have_posts()) { the_post(); // Post Content ...
user avatar
  • 193
0 votes
0 answers
16 views

Wordpress rewrite rule doesn't work unless post category is explicitly called in regex

I'm struggling to understand why WordPress is doing what it's doing in this situation, and I'm hoping someone can explain to me why the rewrite rule doesn't work unless I explicitly call a category ...
user avatar
1 vote
1 answer
35 views

Changing custom type name hides the posts [closed]

I created a custom post type. Plugin used is Custom Post Types & Custom Taxonomies plugin which does the job very good. And added some posts to it. But when I modify the name of the newly created ...
user avatar
0 votes
0 answers
13 views

Custom taxonomy permalink without term, redirection to CPT slug

I have set up a custom taxonomy categorie and i have the associated CPT devis. My permalinks : https://www.website.com/categories >> Go to CPT archive https://www.website.com/categorie/...
user avatar
0 votes
1 answer
32 views

Show/hide posts and categories based on user meta

I've added additional input fields to the user profiles with Advanced Custom Fields (for example "type of customer"). How is it possible to hide posts and categories for users with specific ...
user avatar
  • 101
0 votes
1 answer
82 views

How to conditionally add Custom Post Type to Front Page

I am using the following code to show my custom post types on my front page along with the default post type: // allows the products to show up on the main page function add_custom_post_type_to_query( ...
user avatar
  • 53
1 vote
0 answers
12 views

WordPress combined with a basic MYSQL table [closed]

thanks in advance for any feedback to help me find a solution. == Context == I have my website made in wordpress, in which I have a list of cars that must come from another table in MYSQL (because ...
user avatar
0 votes
1 answer
17 views

Menu for taxonomies and posts belongs to taxonomy

I am currently looking for a solution to the following problem: I have a Custom Post Type named "docs" and for it a taxonomy "docs_category". Note: The taxonomy is hierarchical. I ...
user avatar
0 votes
1 answer
21 views

How to add Support to show Fullwidth Featured Image of Custom Post Types in Wordpress.?

I had created custom post type called "Case Studies" for my Website. Now whenever I am trying share any Post from Case Studies in LinkedIn it showing me preview as small thumb image along ...
user avatar
0 votes
1 answer
24 views

Role capabilities issue

I need some help with capabilities for a CPT. I register a new CPT with a capability type 'agenda'. To do this I use the code below in the register array 'capability_type' => 'agenda', After ...
user avatar
  • 27
0 votes
0 answers
14 views

How to fix the Post Preview Button (CPT & map_meta_cap)

I'm trying to create a custom post type that can be edited by users with a custom role (as well as administrators, editors and authors). Althought the idea for the users with this custom role is for ...
user avatar
0 votes
1 answer
23 views

Url Rewriting a dynamic wordpress page with parameters

I am struggling a bit with how to rewrite a WordPress URL. I have two custom post types that I gave these url structures: mysite.com/erika-mustermann/ mysite.com/offer/shoe-repair/?bername=Erika-...
user avatar
  • 1
0 votes
0 answers
16 views

Fetch data from two custom post types and create multidimensional array for output to html table

I have two CPT (brochures and brochures_so). In both CPT i use ACF field (key = jaar) brochures Jaar (ACF field) Vakgebied (Custom taxonomy) 2021 Wiskunde 2022 PAV 2022 Frans brochures_so Jaar (...
user avatar
  • 101
0 votes
0 answers
45 views

Display list of Custom Post

I created Custom Post Type News. I would like to show the list of Custom Post News at a sub menu of News Info. How can I do that ? My custom post type registration code is like below public function ...
user avatar
  • 387
0 votes
0 answers
9 views

How do I make a request in my browser to search the CPT taxonomy?

How do I make a request in my browser to search the CPT taxonomy? Custom post type "portfolio" Taxonomy "portfolio_entries" Tag "new" The request in the browser of the ...
user avatar
0 votes
1 answer
14 views

How to set category correctly for a custom post created by a remote API call?

I'm using a plugin - "cleverness-to-do-list" (https://wordpress.org/plugins/cleverness-to-do-list/#description ). I'm aware that the plugin is closed, but I've updated it at my end and ...
user avatar
  • 113
0 votes
0 answers
10 views

Restrict Custom Post Type per role in Dashboard

I would like to set up some restrictions on how some roles can access given posts to edit in Dashboard. I have a custom post type affiliates having 2 nested levels. Custom Role User Editor should be ...
user avatar
  • 824
0 votes
1 answer
14 views

Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?

I'm trying to create a dropdown selector on my CPT and CT archive page for a custom taxonomy called "location". I've managed to get the form to submit, however, it does not direct me to the ...
user avatar
0 votes
1 answer
30 views

Display category name of custom posts only once in the loop

I have a custom post type called "Projects" and for it some categories. I would like to display the category name of the posts in the loop but only once. I am using this but the category is ...
user avatar
  • 1
0 votes
0 answers
24 views

Metaboxes inside Tab

I am learning WordPress Plugin development. In this regard I have to save some settings along with Custom Post in Admin Panel under a Menu. Can I place metaboxes inside tab for this issue like the ...
user avatar
  • 387
0 votes
1 answer
17 views

I don't understand why use array inside the add action hook to create custom post type using object oriented way

<?php /* Plugin Name: My Plugin Plugin URI: https://my.plugin.com Description: My plugin description Version: 1.0.0 Author: Me Author URI: https://my.website.com License: GPL2 (or whatever) */ ...
user avatar
  • 1
0 votes
0 answers
11 views

returning the currect URL for nested posts

I have a posttype called (article) witch have a meta_key called (parents_ids). So the article can be related to multiple articles. I want to return the currect URL depending on the parent post For ...
user avatar
0 votes
0 answers
29 views

Change Text in Admin Panel

How can I change the text Posts to News ? I am developing a Plugin. I am working with Custom Post Types.
user avatar
  • 387
0 votes
0 answers
25 views

How to automatically create a terms based on each post of a post type

I am working on a music site which has custom post types- artists, and releases. I have about 3,000 artists, and about 19,000 releases in my database. I'd like to create a new taxonomy term for each ...
user avatar
0 votes
0 answers
16 views

How to Implement Search Functionality?

<div class="col-lg-8"> <div class="row"> <?php $search_term = get_search_query(); $term = ...
user avatar
  • 1
0 votes
1 answer
27 views

Assigning a category to a custom post type in Wordpress

I am working with custom posts to create a 'document' custom post type and then trying to assign the category during wp_insert_post, have tried using both post_category and tax_input to no success. I ...
user avatar
0 votes
0 answers
20 views

Adding /blog in front of single posts (only)

I would like to add /blog in front of the url for a single post: e.g. website.com/blog/news-article -> single article website.com/blog -> blog archive (showing a list of all blogs etc.) Ive ...
user avatar
0 votes
0 answers
21 views

Limiting actions only to edit.php page for specific custom post type

Excuse me if something like this has been asked before. So, I'm trying to alter the query which displays the posts of a custom post type, but on the admin side, more precisely, the edit.php page. This ...
user avatar
  • 13
0 votes
1 answer
40 views

How do I disable the built-in editor and automatically configure the properties of new pages?

I use a Builder plugin on the site. Members are editors and can create their own page. I want to disable Gutenberg so that they can only edit pages with Buldir. I would also disable the properties of ...
user avatar
  • 3
0 votes
1 answer
15 views

How to make a post accessible from multiple post type slugs?

I have two custom post types colors shapes I have a post called "red" under the custom post type "colors". The default URL for this post would be example.com/colors/red Now I ...
user avatar
  • 1
0 votes
0 answers
53 views

Archive page of taxonomy returns a 404 error

I'm trying to create a template file for a custom taxonomy archive page but I keep getting a 404 error when trying to access that archive page. Basically something like: domain.com/quizzes/quiz-levels/...
user avatar
0 votes
1 answer
34 views

date_query empty results with custom post type

I am trying to use get_posts to return data between certain dates but I always get an empty result even though there is a lot of data. This is for a custom post type. $args = array( 'post_type'...
user avatar
1 vote
1 answer
34 views

Filter post by current 2 differents users id

I'm filtering my custom post type based on author. I want all users to be able to: 1 - in the list everyone can see the posts created by the admin. 2 - users can also see their own posts in the list, ...
user avatar
0 votes
0 answers
11 views

Multiple categories assigned to a single product breaking the breadcrumb

custom bread crumb not working with multiple categories assigned to a single product, we do not have the categories page, so don't want to show categories in the URL, but need to show the categories ...
user avatar
  • 199
0 votes
1 answer
82 views

Setting Parent Page to Post

Does anyone know how to achieve different parent pages for posts? I've managed to code a Custom Post Type that sits under a specific parent page, but I want the option to change this from post to post....
user avatar
  • 3
0 votes
0 answers
41 views

redirect after submiting post for review

I have a frontend page that allows "Tutor Instructor" role, to create a course and this course is a custom type post called courses, when the Tutor Instructor finishes creating the course he ...
user avatar
  • 5
0 votes
1 answer
35 views

Insert Custom Post Types

I am learning WordPress plugin development. I need to insert Custom Post Type. I registered custom post type using register_post_type(). I am getting below Form when I would like to insert a New ...
user avatar
  • 387
0 votes
0 answers
53 views

Having a repeating custom field in admin custom post type, what I'd go better with, for DB's sake? ACF repeater or query a different post type?

I have: A main custom post type - 'Cards' - each post showing its ACF repeater custom field - 'operations' - with the following sub-fields: 'add/remove', 'amount, 'value', 'date'. Let's say the fully ...
user avatar