Questions tagged [custom-post-types]

Custom Post Types extend WordPress to support additional content.

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

Problem with customize page cached in WordPress.com

I hosted my site on WordPress.com, now having a problem that I have a customize page that will random generate an ID then create and update database records(custom post type)(using wp_insert_post &...
0 votes
0 answers
16 views

"Menu order" being ignored when querying posts from a parent taxonomy with "include_children" set to true

I have a CPT of articles and a custom taxonomy of collection. This is how the articles are assigned to the collections: Collection 1 Article 1 (menu_order = 1) Article 2 (menu_order = 2) Sub ...
0 votes
2 answers
672 views

Automatically convert standard posts with custom fields to custom post types

I am just beginning a page, and for my current purposes it seems that the only extra things I need are a couple of extra fields for posts of a certain category. Because I only need to add a little ...
0 votes
1 answer
28 views

On archive.php show loop for child categories if they exist or posts if they don't, on custom post type

I have a custom post type 'sch_keynote', with custom taxonomy 'sch_keynotegroups'. On the archive page I have managed to create two loops, one for child categories and one for posts. I only want to ...
1 vote
2 answers
2k views

WP Query with categories only shows one post and ignores the category

I'm trying to make the following mock up with WordPress: https://imgur.com/a/Sem7y I created a custom post type and I created two categories (general and filling instructions). I used ACF plugin to ...
2 votes
1 answer
756 views

handling csv data with a custom post type

I have a custom post type which represents a 'race' and there are meta fields for 'distance' (5km,10Mile) and 'type' (track,road,crosscountry). We get the race results as a csv file which contains the ...
0 votes
1 answer
1k views

load wordpress events into full calendar jquery

I am trying to load my custom post type events into jquery plugin full calendar but nothing is working. I have made a php file with this code include "wp-load.php"; global $wpdb; header('Content-...
0 votes
1 answer
13 views

Problem with custom loop navigation inside the blog page

I have a problem I am not able to solve. I have a custom theme with some custom post types and I need to display an archive for all CPT somewhere in my site. After some reading, I decided that the ...
1 vote
1 answer
845 views

Can multiple authors be assigned on a single custom post?

I have custom post types that I would like to make editable by several users. I created one custom post type using the Toolset plugin. wp_update_post only allows us to set single author: $user_id = ...
0 votes
1 answer
695 views

New WP_Query not isolating custom post types on front-page template

This is the code for my front-page.php template <?php add_filter( 'genesis_markup_site-inner_output', '__return_false' ); add_filter( 'genesis_markup_content_output', '__return_false' ); ...
0 votes
1 answer
1k views

Custom Search Template for Custom Post Types

I know this is asked a million times, and I've found the solution. It seems fairly straight forward but it's not working for some reason. I wonder if it has something to do with the fact that I'm ...
0 votes
1 answer
875 views

Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post

I am building a custom post type and its respective custom taxonomy. Here is the code: add_action( 'init', 'register_my_types' ); function register_my_types() { register_post_type( 'help', ...
0 votes
0 answers
8 views

On click some element i want to use some template

I have a page that calls the template, I made filters using a data-filter.These filters sort out the ALU door and PVC doors. However when I click on the pagination and goes to page 2 to list the other ...
4 votes
1 answer
651 views

Custom taxonomy query for a custom post type

I have a custom post type called news with a custom taxonomy called news category. Right now I have a template called taxonomy-news_category-press.php where press is one of the news_categories. The ...
0 votes
1 answer
1k views

Wp Query sort order from custom MetaBox

I am trying to sort a list of post based of the meta_key deal amount, which would be to display the highest deal first and work its way down to smaller deal amounts. The deal amount would be anywhere ...
1 vote
2 answers
2k views

custom post type category count shortcode

I'd like to create a shortcode that would display the post count for a specific category within a custom post type. I've been trying to alter the code below but need some help. Could anyone let me ...
3 votes
1 answer
621 views

register_post_type - rewrite / feeds, what's it for?

The codex page for register_post_type seems to suggest that it should be possible to disable feed generation for custom post types: rewrite (boolean or array) (optional) Triggers the handling of ...
0 votes
0 answers
26 views

Custom Post Type with Different Sets of Post Content?

I have a custom post type called "Industry" and want to allow for a given Industry post to have different sets of post content depending on "Region". The post type would have a ...
0 votes
1 answer
13 views

Wordpress giving me the index

i'm having a problem and i can't seem to figure out how to solve it. I'm just beginning to develop custom themes in wordpress and i wanted to create the custom template for portfolio and a single page ...
7 votes
3 answers
32k views

How to remove "Archive:" label from archive title

I need to remove "Archive:" label from the archive page title. I tried this string without results: <?php the_archive_title('<h2>','</h2>', false);?> The title keeps ...
0 votes
0 answers
11 views

Rename existing cpt and taxonomy with new textdomain

I'm developping a small plugin to rename existing custom post type from a theme (Divi). I use this code : add_filter( 'register_post_type_args', 'rename_project'); function rename_project( $args, $...
4 votes
1 answer
778 views

How to show more posts on an archive page?

I'd like to show more posts on my custom archive page, but can't seem to figure out the right way to do it. Currently it displays 10, which is the number set in WP Settings and the number I'd like on ...
7 votes
4 answers
8k views

How to remove Filters from post admin page?

On a custom post type, I want to remove the filters that show up on /edit.php (where all of the posts are listed out). I have a custom taxonomy that shows up as a filter that I WANT to keep, but I ...
0 votes
1 answer
1k views

Custom Post type doesn't appear in search results

I am working on a plugin where I am adding a custom post type and inserting its posts based on wp_insert_post function once the plugin is activated. The problem is that the custom post types cannot ...
7 votes
6 answers
10k views

How can I convert Posts into Custom type posts?

I have a Wordpress site that I just updated to 3.1. I want to make use of custom post types now, my question is how can I assign (transfer?) a post to a newly created custom post type ? For example, ...
1 vote
0 answers
11 views

How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT

What I have: example.com/movies/{post} <!-- custom Post Type single post, e.g. /movies/batman --> example.com/genres/{term} <!-- custom Taxonomy single term e.g. /genres/action --> What ...
0 votes
0 answers
13 views

Custom post type set default template using block editor

So i am using the block editor to build a page and I created several custom post types. Usualy I would Just create a template in the classic way but since i want to use the block editor i was ...
0 votes
2 answers
1k views

Custom post type slug as page slug

I have a custom page type dictionary and all of the dictionary items have URLs like this: example.com/dictionary/item dictionary has has_archive => false The problem occurs if I also create a ...
0 votes
0 answers
19 views

"Author" custom post type

I have an existing WP site where there is a custom post type called Author with a few hundred entries. I need to create a single entry page from these authors, but single-author.php just returns a 404....
0 votes
0 answers
14 views

Not Able to Add New Class To CPT Attachment Image

Testing against WordPress 6.0 and using Codex, get_image_tag_class filter to remove all existing default classes and add new class img-fluid is not working Here is the code that I am using in ...
0 votes
1 answer
22 views

Custom Post type collection

If you've set up custom types and given them a custom slug through register_post_type 'rewrite' => array( 'slug' => "shoes" ) Can you assign a template for /shoes/? At the moment ...
2 votes
1 answer
1k views

Hyphens instead of Underscores in Post-type Archive Template Filenames when Post-type handle contains underscore

I'm working on implementing WordPress coding standards on a theme which has several custom post-types, each of which have underscores in their handles. The theme uses the custom post-type handle in ...
1 vote
1 answer
1k 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
1 answer
631 views

Get posts in same category not working

I have a custom post type with custom category taxonomy. On the CPT single templae I want to list out other posts in same categories, but I can't get it to work. My current code: <?php foreach ( ...
0 votes
2 answers
1k views

Using post title in an array

I want to use the the_title() function to get the title of a post and then reference that title in an array. Code is as follows: <?php $title = array( the_title() ...
0 votes
2 answers
25 views

hide specific div on single.php [closed]

I've been working on WP since a week so far i've seen bunch of tutorials and videos about wp but i feel stuck and since i'm a wp noob i cant find or think any solution for a simple problem. i have ...
1 vote
1 answer
1k views

wp_get_archives() not working for my custom post type

I have my custom post type working, but I can't seem to get the archives working. Here is my code for getting the archives: <ul> <?php $args = array( 'type' => '...
0 votes
2 answers
726 views

Custom metabox with image gallery upload that won't attach images to post

I have created a custom metabox with an image uploader that will upload multiple images into a gallery that I can then query. It all works accept for the fact that the images don't show as attached to ...
-1 votes
5 answers
6k views

How can I get user URL by id

I am using custom post types, and I have a problem getting the author URL to his profile. I can get the author ID using: $authers_interviewdoctor = get_post_meta( $post->ID , '...
0 votes
1 answer
746 views

How to display custom post types AND regular posts separately on a shared taxonomy archive?

I've looked over numerous questions and answers on problems somewhat related to this but can't seem to find the same situation or solution. I have a custom taxonomy that needs to have an archive page ...
0 votes
0 answers
14 views

Is it a connection or relationship between 2 custom post types?

im working on it now for two days and no outcome. I have woo products and custom post types called "lankytinos", what I need to do: You open product and there are the list of "...
2 votes
2 answers
870 views

Assign Taxonomy Based on Custom Field Value

I have a custom post type "vegetables" I have a series of custom fields for each month of the year as check boxes I have a custom taxonomy "Seasons" that I want to assign based on what boxes are ...
0 votes
1 answer
861 views

CPT tags not showing when editing post

Since Gutenberg I've used the plugin "Classic Editor" for one of my websites until I have time to make the necessary adjustments to fully work with the new Gutenberg look. I'm now starting to look at ...
0 votes
1 answer
700 views

Change custom post type permalink according to category

Actual: http://localhost/wp/subtitle/title-shahbaz/ Post type: subtitle Category of this post: internal Want to show everywhere and also in URL bar:http://localhost/wp/internal-subtitle/title-shahbaz/...
0 votes
1 answer
2k views

Publishing failed. The response is not a valid JSON response

I am using wordpress 5.4.2. I get this error when trying to add a new post. I changed my permalink to Post name sample http://localhost/wordpress/sample-post/ How should i change my .htaccess My ...
0 votes
1 answer
1k views

Custom Post type shortcodes

I create a custom post type (features) in my theme with Advanced Custom Field. I want to know how i can create a shortcodes of my custom post type. so that i just used a shortcode of that custom post ...
0 votes
1 answer
30 views

Wordpress is ignoring my post rewrite rule

I have the following code to change Posts to News, and add news-insights to the URL of every post: function cp_change_post_object() { $get_post_type = get_post_type_object('post'); $labels = $...
0 votes
1 answer
1k views

Work and Display a Custom Post Type as a normal Post

I've created some Custom Posts for my Wordpress page and I can work fine with them. I can create a new one, edit it and display it in "archive-custom_post_type_name.php" and many more things. I can ...
1 vote
1 answer
678 views

re-register custom post type with custom capabilities

I have created custom post type as below. register_post_type( 'connector', array( 'labels' => array( 'name' => __( 'Connectors' ), 'singular_name' => __( '...
3 votes
1 answer
1k views

Get list of terms of current taxonomy archive for another taxonomy

I have a Custom Post Type named 'Real estate' which has (amongst others) two different taxonomies: 'Purpose' (hierarchical; terms used are 'Living', 'Working' and 'Holidays') and 'Location' (non-...

1
2 3 4 5
203