• Resolved magirland

    (@magirland)


    This is a great theme! I am working on creating a new template file and was wondering which file is the “default” page template that shows up as a choice when creating new pages. I found the template-blank.php and the template-no-sidebar.php but was wondering which one would be like a default page.php file? Thank you in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author ronangelo

    (@ronangelo)

    The default template file used by Posts and Pages is loop-single.php.
    If you plan to create a new template you’re better off copying the Full ( no sidebar ) page template to your child theme, edit it and rename the template name inside the file and if necessary, add a <?php get_sidebar(); ?>

    Thread Starter magirland

    (@magirland)

    Thank you! I did that as a test and created a template. My sidebar, however, is now in the main part of the page ( please see https://www.520families.com) and the text content for the page is below the sidebar.
    Here is the code for my template file:

    <?php // Template Name: Camps ?>
    <?php get_header(); ?>

    <div id=”content-nosidebar”>
    <?php do_action(‘ast_hook_before_content’); ?>

    <!– Widgets: Before Content –>
    <?php if ( is_active_sidebar(‘widgets_before_content’) ) : ?>
    <div id=”widgets-wrap-before-content”>
    <?php dynamic_sidebar(‘widgets_before_content’); ?>
    </div>
    <?php endif ; ?>

    <?php get_sidebar(); ?>

    <?php
    the_post();
    get_template_part( ‘loop’, ‘single’ );
    ?>

    <?php do_action(‘ast_hook_after_content’); ?>
    </div>

    <?php get_footer(); ?>

    Thread Starter magirland

    (@magirland)

    Actually, here is the correct link to the page that shows my new template: https://520families.com/test/
    Thank you again.

    Theme Author ronangelo

    (@ronangelo)

    Change id="content-nosidebar" to id="content"
    Move <?php get_sidebar(); ?> on top of <?php get_footer(); ?>

    What exactly are you trying to do with this new template?

    Thread Starter magirland

    (@magirland)

    Thank you– that worked! I’m trying to work with Easy Content Types with this new template.

    Thread Starter magirland

    (@magirland)

    I am using “Creating a Simple Event System” https://pippinsplugins.com/creating-a-simple-events-system-with-easy-content-types/
    I am wondering which template to use and where to insert this code (the loop-single.php or the Full ( no sidebar ) page template:

    <?php get_template_part (‘content’, ‘events’); ?>

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘file for default page template’ is closed to new replies.