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

learn more… | top users | synonyms (1)

3
votes
1answer
66 views

$query->set in pre_get_posts is unintentionally affecting the backend

So, I have a custom post type, 'properties'. I'm using archive-properties.php, and need to set some parameters on the $query. I don't want to use new WP_Query since I ran into some issues where a ...
0
votes
0answers
24 views

Permalink custom post type and custom taxonomy

I have problems with making permalinks. I have multiple custom post types. Lets say cpt1 cpt2 cpt3 I have one custom taxonomy with few categories. Lets say : cat1 cat2 cat3 All custom post ...
0
votes
1answer
20 views

Meta Box doesn't appear

I have 3 custom post types and 3 meta box files. The problem is I include files in functions.php. I have three meta box PHP files for each custom post type, but it just shows one meta box fields of ...
0
votes
0answers
14 views

Custom post type shows all if no post from user

I'm trying to achieve this (without using any plugins): Adding custom post type Allow subscribers to create, edit, view their own posts "only" in wp-admin I'm using this code: ...
0
votes
1answer
54 views

Custom post type and category link together

I have issue with making new page for this : Category link is : /category/category_name But I want to be : /custom_post_type/category_name Custom post type code $labels = array( ...
0
votes
2answers
59 views

Certain number of posts with certain excerpt length

Could use some help... using this code to call up a custom number of posts from a certain categorey and only want to display the first 15 characters. However, it is showing the same excerpt on each ...
0
votes
0answers
15 views

Strategy for organizing JSON/tabular data the wordpress way?

Situation: Have to import about 20-100 JSON objects into wordpress, which will NOT be displayed at all, but will be processed with other data for view. Example JSON input: { "headers": [ ...
2
votes
1answer
38 views

Listing posts with wp-cli

I use wp-cli to export some posts from my WordPress database. I'm trying to understand the differences in behavior that are exposed in the example below: $ wp post list --path=/var/www/home-web --...
1
vote
0answers
21 views

Add custom capabilities to existing custom post type

The only way I can find to associate post types with custom capabilities is during the register_post_type function. I'm looking to add a capability for a certain role (my_role) for a post type that ...
1
vote
0answers
40 views

Custom Post Type relationship with hierarchical parent and child permalinks

Trying to get my permalink and url structures to behave nicely. I have a Custom Post Type called Diseases. This post type is hierarchical with parent and child relationships. I have another CPT ...
0
votes
0answers
41 views

Make shortcode work in all posts displayed by loop, not just the first one

I have a post archive displaying post and author meta at roadtripsharing.com/road_trip I added a do_shortcode(); in the loop, specifically related to the "New Message" button which opens a dialogue ...
0
votes
1answer
38 views

Odd behaviour for the update button when displaying a WP_List_Table

I am currently trying to add a WP_List_Table to a metabox in the edit page of a custom type. The code is currently class Post_Table extends WP_List_Table { public function __construct() ...
0
votes
0answers
39 views

How Do I Attach Custom Taxonomies to a Custom Post Type?

I'm having trouble attaching custom taxonomies to a post (CPT) submitted via a frontend form. For some reason, whenever a new post is created, new fields in the wp_terms table (containing the IDs of ...
0
votes
1answer
45 views

Custom Post Type: Search Results - Template for no results

My custom-post-type is a Property Listing and on the Homepage there is a Search form. The Search Form works fine if there is a Property or Properties Matching the results. If there are no Properties ...
0
votes
1answer
37 views

Adding `supports` array to WordPress custom post type

I am trying to add the supports parameter to my custom post type but it is not working and renders the editing page blank: add_action( 'init', 'create_post_type' ); function create_post_type() { ...
0
votes
0answers
20 views

Storing a many to many post type relationship in post meta and keeping SQL ability for Joins

I have 2 Custom Post types and i am manually keeping a relation between them in a many to many relationship by keeping an array as a custom field. All PARENT post types have ONE filed in wp_postmeta ...
0
votes
1answer
65 views

Foreach in get_post_types to apply a different filter per post type

I have a class in my plugin with the following function: protected function get_post_types($output='names') { if (! is_array($post_types = get_post_types(array( 'show_ui' => true ), $output))) ...
0
votes
1answer
28 views

Display subcategories in the filter on CPT

I have a little problem with my CPT. I created some categories with subcategories, and I wish display the subcategories in the select filter. Actually, the categories filter display only the first ...
0
votes
2answers
31 views

Style post formats differently only in single

I want to use post types to style video posts differently. This should be quite easily achieved with custom post types. But I only want the video post type to affect the post when it is in "single". ...
0
votes
1answer
25 views

Option page's form doesn't work

I have two option pages: General Options > MyOptionPage1 and CustomPostType > MyOptionPage2 Both have a form, but the after clicking Save in second option page I land in the 404 page. Here is ...
0
votes
0answers
18 views

Custom Post Type - after disable 'Add New', I can't edit and delete post

I need to disable 'Add New' button for my CPT, but when I add: 'capabilities' => array( 'create_posts' => false, 'edit_posts' => true, 'edit_post' => true, 'delete_post' =&...
0
votes
0answers
20 views

Auto insert custom post type title

Is it possible to change the custom post type title based on another selected field? Basically i'm trying to do this:
0
votes
0answers
31 views

Remove CPT slug in multisite installation

I would like to remove the custom post type slug from the site url. Searched hours for a solution. Didn't find a working one and can't resolve it on my own. It is a domain-based multisite installation....
0
votes
1answer
57 views

Custom post type archive page not showing on archive-posttype.php

I am trying to create archives page for my custom post types but it is going to a default archive page not the archive page which i have created for archives Here is my code for custom post type ...
0
votes
1answer
37 views

Custom post type with two templates

I have a custom post type with an archive-my-post-type page and now I need a second archive page without header and footer and with a custom content. So my question how can I create a second page ...
0
votes
0answers
25 views

Custom Post Type - multiple in single menu position

I currently have a couple of 'Custom posts types'. Currently, each of them has a separate item on the menu but I would like to add them all as sub for one position. I have somethink like this: Movies ...
0
votes
2answers
41 views

Remove custom post type generated by a plugin (The Events Calendar) [closed]

On my client's site, I had installed the plugin "The Events Calendar". I noticed after uninstalling, the event archive page still remained and I could not find a way to remove this page. I have ...
0
votes
0answers
27 views

CPT url rewriting : regular posts return 404 error

I have a WP website where a created a CPT named product, which has several custom fields, including a category field. This "category" is a custom taxonomy that can take several values, let's say : ...
1
vote
1answer
27 views

Page vs Custom Post Types Differences/Issues

I started noticing issues last week when 4.5 was released and mistakenly believed that update caused an issue. In reality, I just happened to notice it for the first time around then because last week ...
4
votes
2answers
76 views

Password-protect a custom rss feed

I've created a custom post type and would like to send those posts to FB Instant Articles and Apple News via a RSS feed. I've created a custom RSS feed and need to know what's the best way to make ...
0
votes
0answers
19 views

Multiple Themes Rewrite

I have installed a plugin called Multiple Themes, formely jonradio Multiple Themes. My website has 3 themes which represent 3 different locations (A, B and C). A = primary theme. All themes share ...
-1
votes
1answer
22 views

Taxonomy listing issue - does not display how I would like

What I have is a: Taxonomy: menu_type Term: drink (parent term) Sub term: drink 1, drink 2 (child terms) Term: appetizer (parent term) Sub term: appetizer 1, appetizer 2 (child terms) I ...
0
votes
0answers
23 views

I need “View” option in posts wp-admin to show a page for admin, not open website view

Ok I have searched and Googled for this and I couldn't find anything useful, so here's the basic question that I have: Do you know when you are inside wp-admin and you have that "View" option on ...
0
votes
1answer
25 views

Displaying a custom post type using get_template_part into a specific layout

I am new to wordpress custom themes and am trying to recreate this website (http://www.divecarib.com/) as practice. I am trying to find the correct way to achieve the following: I have created a ...
0
votes
0answers
35 views

How to order posts by meta key?

I have posts with a meta_key "sticked" and value="1". How can I get all posts and display the posts with meta_key "sticked" first? $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;...
0
votes
0answers
13 views

Custom rewrite rules on custom posttype

I've got a problem presented to me by a client which I can't seem to fix. They have a Wordpress website with a custom posttype 'projects' This custom posttype has a custom taxonomy 'categories' What ...
0
votes
0answers
44 views

Can I add category list in wordpress TinyMCE custom button

I want to create a custom post type gallery plugin.I already create shortcode and create TinyMCE button But I can't add Taxonomies list in TinyMCE-button.js file. how can I add this? my code is php ...
0
votes
0answers
36 views

Manage edit-post type columns custom post type separate page

I am designing a plugin with post type cars. The plugin have one page to display cars in columns (Just like posts and pages list). I used following code to add columns: add_filter( 'manage_edit-...
0
votes
2answers
54 views

Hide specific taxonomies from a taxonomy list using 'get_object_taxonomies'

Hello, I have a 'Custom Post Type' with 8 taxonomies and I'm pretending display a list with only 6 taxonomies and the no empties terms of each one and hide 2 taxonomies. My current code displays all ...
0
votes
0answers
51 views

wp_get_archives doesn't work with 'post_type' with WordPress 4.5

wp_get_archives support the post_type parameter from 4.4.0, so I decided to add a <select> on the cpt's archive page. Unfortunately wp_get_archives returns with NULL. Do you have any idea what'...
0
votes
2answers
70 views

Get post ID from wp_insert_post()

$new_post = array( 'post_title' => $title, 'post_content' => $description, 'post_category' => array($...
0
votes
0answers
25 views

How to edit 'aside' post format in for a custom post type

I have created my custom post type using following code add_action( 'init', 'post_job' ); function post_job() { register_post_type( 'job', array( 'labels' => array( 'name' => 'Jobs', ...
0
votes
0answers
26 views

Custom post types from custom database

For a plugin I want to use custom post types based on data stored in an external database. This database isn't related to WordPress (the structure of the tables is independent). The datastructure is ...
1
vote
1answer
41 views

Filter the content from a post globally immediately after is fetched from the database

I am encrypting the content of a specific custom post type whenever i am updating or creating it. That is working fine. Is there a way to globally decrypt the content for all WordPress read ...
0
votes
1answer
60 views

get_post_permalink() and custom permalink rewriting

I've been working on a CPT named "product" that has custom permalinks. Here is a part of this CPT : 'rewrite' => array( 'slug' => 'catalog/%product-cat%', 'with_front' =...
1
vote
1answer
26 views

URI returns a post when it should return a 404

Morning All I have a question and I think I have a solution as well, but I wanted to ask to see if my thinking is correct. I have wp site live at http://www.phmotorcycles.co.uk and I have just found ...
0
votes
1answer
13 views

Post Custom & Taxonomy 404 error

Basically the single Permanent link are giving me 404 errors. might be wrong? Code is below: function post_types(){ register_post_type('carta',array( 'labels' => array( '...
0
votes
1answer
13 views

Retrieve custom post by a query on one of its custom fields

I've been using custom posts on my website, among them there are : "session" and "lecture". The custom post "lecture" has many custom fields such "title", "duration"... The custom post "session" ...
0
votes
0answers
24 views

Get posts from two taxonomies

I've created post types and taxonomies using Custom Post Type UI plugin. There are two taxonomies: rubric and city. Each taxonomy post lists are available at URLs /rubric/toaster/ and /city/kiev/. I ...
0
votes
3answers
55 views

Editable content on a Custom Archive page

I want to allow my client to change some introductory text on a custom post archive page (eg. archive-unicorn.php), but I can't see how to do this. I guess one way I could do this is would be to ...