-3

Possible to add template Selector box while page creation in wordpress

0

WordPress has this built in. As long as you have a page template created in PHP it will give you an option to use the template when creating a new page.

You can create a page template by adding this short snippet to the top of your PHP file.

<?php /* Template Name: Example Template */ ?>

For example, you could copy page.php and add the above code, then make any template specific changes and you will have a new page template.

Something like this...

<?php /* Template Name: Example Template */ ?>

<?php get_header(); ?>

<main>
    <div class="container clearfix">
        <?php
            while (have_posts()) :
                the_post();
                get_template_part('template-parts/content', 'page');
            endwhile; // End of the loop.
        ?>
    </div> <!-- /container -->
</main>

<?php get_footer(); ?>

Here is what it looks like in WP 5.2.2 admin.

enter image description here

You should defiantly read up on PAGE TEMPLATES.

  • is there any plugins are there for create and select template for wordpress page – kannan Jul 15 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.