Articles of custom post types

How do I include drag-and-drop in a plugin?

I want to build a WordPress plugin that will allow users to add and delete fields from a custom post type. I want them to be able to do this with drag-and-drop, just like they add widgets to a sidebar. That is to say, the plugin will have a group of allowable fields, and the […]

query multiple taxonomies

I have a function set up to show ‘Similar Products’, i.e. showing products that share the same products-category taxonomy term. This works great but I want to narrow the function even further and make it more specific. Thus I want it to look at 2 taxonomies (product-category and space) to find similar products. The current […]

Plugin templates in which directory

Currently I have a number of custom posts as plugins, which process data and send them to the plugins respective template. I use Roots theme as a basis and currently store my plugin templates in the main theme directory. However, I’m thinking of moving each of these to their respective plugin folder. Are there any […]

How can i skip same post from taxonomy term?

I’m trying to retrieve the posts of specific taxonomy categories. I have two taxonomy categories. Category One Category Two In these two have some different and same posts. So when i retrieve the data through terms id then query return some post two times, because these posts are link from above two categories. $ourwork_cat_ids = […]

Display posts if a custom field value is equal to another custom field value

I have 2 custom post types “Shops” and “Restaurants”. Each of these have custom fields associcated with them. For example, One field in Shops is “Shop ID” and one in Restaurants is “Restaurant ID”. I want to query both Custom Post Types and if Shop ID is 20, I want to display all Restaurants with […]

How to create a json API for my custom post type

I’d like to create a json API that I can access publicly for my custom post type without help of any external plugins in WordPress. Can anyone shed some light on it please?

Parent & Child Taxonomy slugs in custom post permalink

I’ve registered a custom post type “book” and a taxonomy “authors” as below: add_action( ‘init’, ‘post_book_init’ ); function post_book_init() { $labels = array( ‘name’ => ‘BOOKs’, ‘singular_name’ => ‘BOOK’, ‘menu_name’ => ‘BOOKs’, ‘name_admin_bar’ => ‘BOOK’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New BOOK’, ‘new_item’ => ‘New BOOK’, ‘edit_item’ => ‘Edit BOOK’, ‘view_item’ => ‘View […]

Create category only for custom post type

All, I’m creating my own post type using the following code: add_action( ‘init’, ‘create_team_post_type’ ); function create_team_post_type() { register_post_type( ‘team’, array( ‘labels’ => array( ‘name’ => __( ‘Teams’ ), ‘singular_name’ => __( ‘Team’ ) ), ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => true, ‘capability_type’ => ‘post’, ‘hierarchical’ => false, ‘menu_position’ => […]

Change plugin's has_archive = true to false?

When a plugin registers a post type and sets has_archive to true, is there a way to change it to be false? I don’t want the plugin’s post type to have an archive, but can’t figure out how to turn it off. A similar questions was asked here, but has no responses: Changing a custom […]

Add theme options to custom post type admin pages

I have custom post types set up using CCTM plugin and I’m using the Bridge Theme by Qode. The theme adds options to the posts and pages admin (custom theme options, title area, header etc.), I’m trying get the same options for the CCTM pages in the admin. I’ve been through the functions.php for the […]