• i’ve created the custom post type using cptui plugin. i want to show the category title,description and featured image in altenative odd or even like below ex
    .Ex:
    https://fskador.se/myPerformanceLast/test

    and how to create custom template. i tried archive-my_post_type.php and single-my_post_type.php . but its not working how to do cutom template for cpt

Viewing 1 replies (of 1 total)
  • You can create your own page template, without plugin, quite easily.

    Same goes with post type, but you need to touch a bit your theme aka in a theme’s functions.php file:

    <?php add_action( ‘init’, ‘create_post_type’ );
    function create_post_type() {
    register_post_type( ‘potato’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Potato’ ),
    ‘singular_name’ => __( ‘Potato’ )
    ),
    ‘public’ => true
    )
    );
    }
    ?>

    Once done, you’ll be able to register potato as a new post type, and it will be fully rendered at your url as a post type. Of course this post type might be extended.

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Custom post type loop’ is closed to new replies.