Articles of custom post types

Custom Post Types,Permalink and Heirarchy

Basicly I want to indroduce a custom heirarchy with custom post types. I Would like it to be like this. The Main Brands URL : http://localhost/brands/ which lists different types of Brands. The personal Brand URL : http://localhost/brands/nike which displays overview of brand “nike” andlinks to different post types made by that particular Brand Account. […]

Change Slug of a Custom Post Type

I use a plugin that creates a custom post type with a slug that I am wanting to change. I don’t want to overwrite the plugin files, so I’m wondering how I can change the slug using a separate function? Thanks. // Register post type add_action( ‘init’, ‘ctc_register_post_type_item’ ); function ctc_register_post_type_item() { // Arguments $args […]

add custom field to custom post type

I want to add custom field of file uploading control to upload image files in my custom post type page(New/Edit). I have searched in Google but no tutorials have been found. please, help me. Thanks in advance.

How to check if user meta field is empty in conditional else statement

Hello all I have a custom post type set up for my wordpress site within this custom post type i have a meta box with about 11 meta fields that I have added programatically. What I would like to do is check if one of the fields (which i have programmed to be a radio […]

Calling related posts to a custom post type, taxonomy & Tag id

I’m trying to call the related posts of a custom post type by the category of the post that is loaded on the page. Below is where I am at – <?php $blogcats = get_the_term_list(); if (( ‘post’ == get_post_type() )) { $posttypenews = ‘post’; } if (( ‘blog’ == get_post_type() )) { $posttypenews = […]

Pagination for custom post types – url rewriting

I’m working with custom post type, that I want to paginate, here’s part of code, initializing custom post type: $args = array( ‘labels’ => $labels, ‘public’ => false, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘show_in_menu’ => true, ‘query_var’ => true, ‘capability_type’ => ‘post’, ‘has_archive’ => true, ‘hierarchical’ => false, ‘menu_position’ => null, ‘supports’ => array(‘title’, […]

How to add the post ID (or any other post data) to a Contact Form 7 mail?

I’ve downloaded Contact Form 7 to add contact forms adding a simple snippet after every post, and I’ve added it in functions.php like this : //if post type I add a form function is_post_type($type) { global $wp_query; if($type == get_post_type($wp_query->post->ID)) return true; return false; } function add_post_content($content){ if(!is_feed() && !is_home()&& is_single() && is_post_type(‘post’)) { $content […]

Having Issue on Getting Metabox Checkbox Value

I have a Custom Post Type with two Metabox attached as: $offerPrice = isset( $productValuesl[‘offer_box’] ) ? esc_attr( $productValuesl[‘offer_box’][0] ) : ”; $offer = isset( $productValuesl[‘is_offered’] ) ? esc_attr( $productValuesl[‘is_offered’][0] ) : ”; <tr> <td ><label for=”price_box”>Product Price : </label></td> <td align=”left”><input type=”text” name=”price_box” id=”price_box” value=”<?php echo $price; ?>” /></td> </tr> <tr> <td align=”” style=””><label […]

Get child categories of custom taxonomy category?

I am using custom post type : portfolio and have taxonomy for that portfolio_category. I need to get sub categories for a particular category using the above custom taxonomy. In short, How can I get the child categories for taxonomy=portfolio_category&tag_ID=80&post_type=portfolio?

How can I lock specific posts (cpt's) from editing by anyone other than ADMINS

To be 100% clear, this has nothing to do with the front end of the site. I want to keep all users other than Admins from editing a few specific posts. The posts are a CPT that the editors/admins can create and modify, but 3 of them need to be locked so that only admins […]