joshwlc
asked 6 years ago

I am not sure I have the content wrapper start file correct for my theme. I have followed your instructions but not sure I have it correct.
Here’s what my themes page.php looks like:
<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other ‘pages’ on your WordPress site will use a
 * different template.
 *
 * @package tdlight
 */

get_header(); ?>

    <div id=”primary”>
        <div id=”content” role=”main”>

            <?php while ( have_posts() ) : the_post(); ?>

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

                <?php
                    // If comments are open or we have at least one comment, load up the comment template
                    if ( comments_open() || ‘0’ != get_comments_number() )
                        comments_template();
                ?>

            <?php endwhile; // end of the loop. ?>

        </div><!– #content –>
    </div><!– #primary –>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
Based on the above, what should I make my content start wrapper file?
Really appreciate any advice you can give here. I think I have the rest correct except for this content start wrapper file. Thanks so much.

joshwlc
replied 6 years ago

Does anyone have any ideas?

You can see what I’m talking about here:

http://www.weight-lifting-complete.com/questions-from-members-of-wlc/

If I am actually logged into my site, it looks correct. But when I am logged out of WordPress, it doesn’t look correct.

And I am getting a repeat of the question at the top of every page. I believe this is due to the content wrapper file I made. Pretty sure it has many mistakes but I am not in expert in php code to fix the problems.

Please help if you can. Much appreciated.

1 Answers
BigHug
answered 6 years ago

Hi joshwlc,
Base on your page.php file:

<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other ‘pages’ on your WordPress site will use a
 * different template.
 *
 * @package tdlight
 */ get_header(); ?>
    <div id=”primary”>
        <div id=”content” role=”main”>
            <?php while ( have_posts() ) : the_post(); ?>
                <?php get_template_part( ‘content’, ‘page’ ); ?>
                <?php
                    // If comments are open or we have at least one comment, load up the comment template
                    if ( comments_open() || ’0′ != get_comments_number() )
                        comments_template();
                ?>             
<?php endwhile; // end of the loop. ?>         
</div><!– #content –>
    </div><!– #primary –>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

You can start to make your content-start-wrapper.php :

<div id=”primary”>
        <div id=”content” role=”main”>

End, content-end-wrapper.php:

        </div><!– #content –>
    </div><!– #primary –>
<?php get_sidebar(); ?>

Hope this helps!

Powered by DW Question & Answer Pro