Custom post template doen’t have any

is the page supposed to display single posts?… then according to the WordPress Codex Docs you will have to rename your file from gallery-post.php to single-gallery.php Now if it is just a post-format you will have to register it in your functions.php file and see if that works. I hope it helps.

How do you make a custom post type invisible for subscribers

register_post_type() accepts a parameter capabilities in its arguments. See get_post_type_capabilities() for possible values. you can add these settings in your code while registering the custom post type ‘capabilities’ => array( ‘edit_post’ => ‘update_core’, ‘read_post’ => ‘update_core’, ‘delete_post’ => ‘update_core’, ‘edit_posts’ => ‘update_core’, ‘edit_others_posts’ => ‘update_core’, ‘delete_posts’ => ‘update_core’, ‘publish_posts’ => ‘update_core’, ‘read_private_posts’ => ‘update_core’ ),

Simple Data picker meta box

No ones was answering so i installed this plugin MetaBox.io and I’ve generated this code below that worsk very vell. function arrivo_metabox( $meta_boxes ) { $prefix = ‘arrivo-‘; $meta_boxes[] = array( ‘id’ => ‘arrivo’, ‘title’ => esc_html__( ‘Data di arrivo in negozio’, ‘porto-child’ ), ‘post_types’ => array( ‘riparazioni’ ), ‘context’ => ‘side’, ‘priority’ => ‘default’, … Read more

WordPress trying to query two custom types to get child from the parent

So I was finally able to find what I needed: $loop2 = new WP_Query([ ‘post_type’ => ‘service’, ‘numberposts’ => -1, ‘meta_key’ => ‘_wpcf_belongs_service-category_id’, ‘toolset_relationships’ => [ ‘role’ => ‘child’, ‘related_to’ => $parent_id, ‘relationship’ => [‘service-category’, ‘service’] ] ]); https://wp-types.com/documentation/customizing-sites-using-php/displaying-child-posts/

Remove CPT Slug with 2 taxonomies and 1 post meta

Managed to get it sorted in the end, needed to add a rewrite rule (see below) if you need full source code then let me know and I will be more than happy to paste it. public static function add_rewrite_rules() { add_rewrite_rule( ‘^([^/]+)/([^/]+)/([^/]+)/([^/]+)/?’, ‘index.php?post_type=products&product_holiday=$matches[1]&_product_countries=$matches[2]&_product_types=$matches[3]&name=$matches[4]’, ‘top’ ); } add_action(‘init’, array( __CLASS__, ‘add_rewrite_rules’) ); Thanks,