Custom post type not displaying content from single-{custom post type} page

You need to rename loop-{custom-post-type}.php to single-{custom-post-type}.php. And to be explicit, the actual filename, based on your code above, should be: single-vfic_publications.php. Get rid of any other template redirects or anything else similar that you’re using. As per the Template Hierarchy, if you have a Custom Post Type named vfic_publications, and a template file named … Read more

Checking if Post Title is Unique as Loop Criteria

In case anyone’s wondering I managed to get this fixed with a pointer about using var_dump(). Here’s the modified loop. function build_home_id ($pcode_id, $assigned_id_no) { //$cmplt_id = $pcode_id . “-” . number_pad($assigned_id_no, 3); // Gets postcode string and calls the number padding function to add the leading 0’s do { $cmplt_id = $pcode_id . “-” … Read more

Remove edit or add facility for custom post type

For say the ‘moomin’ post type, when defining the custom post type specify its ‘capability_type’ as ‘moomin’. This will give you the ‘capabilities’ edit_moomin’ etc which you can then remove from individual roles, e.g.: global $wp_roles; // remove capability edit_moomin from role editor $wp_roles->remove_cap( ‘editor’, ‘edit_moomin’ ); @Simon Forster claims readonly posts IS possible, if … Read more

Rewrite post type slug only for child theme

Make the slug translatable when you register the custom post type: register_post_type( ‘post_type_name’, array ( ‘rewrite’ => array ( ‘slug’ => _x( ‘post_type_name’, ‘URL slug’, ‘your_text_domain’ ) ) ) ); Then create a small plugin for the site where you want to change the slug: add_filter( ‘gettext_with_context’, ‘change_my_slug’, 10, 4 ); function change_my_slug( $translation, $text, … Read more

Custom Post Type Nav to Subpage

You say that you know about show_in_menu parameter for register_post_type() but it seems like you missed the options for this parameter: ‘false’ – do not display in the admin menu ‘true’ – display as a top level menu ‘some string’ – If an existing top level page such as ‘tools.php’ or ‘edit.php?post_type=page’, the post type … Read more