WordPress.org

Ready to get started?Download WordPress

Forums

How do I add a sidebar to a Fullwidth page ? (5 posts)

  1. AlexSandager
    Member
    Posted 1 year ago #

    How can i add a sidebar to a fullwidth page ? , you can find the code below. Really need help.

    <?php
    /**
     * Template Name: Full Width, no sidebar(s)
    */
    
    get_header(); ?>
    
        <div id="main-fullwidth">
    
            <?php
                if (have_posts()) : while (have_posts()) : the_post();
                    /**
                     * Find the post formatting for the pages in the post-page.php file
                     */
                    get_template_part('post', 'page');
    
                    if(comments_open( get_the_ID() ))  {
                        comments_template('', true);
                    }
                endwhile;
    
                else :
                    get_template_part('post', 'noresults');
                endif;
            ?>
    
        </div><!-- #main-fullwidth -->
    
    <?php get_footer(); ?>
  2. vahidd
    Member
    Posted 1 year ago #

    Try this:

    <?php
    /**
     * Template Name: Full Width, no sidebar(s)
    */
    
    get_header(); ?>
    
        <div id="main-fullwidth">
    
            <?php
                if (have_posts()) : while (have_posts()) : the_post();
                    /**
                     * Find the post formatting for the pages in the post-page.php file
                     */
                    get_template_part('post', 'page');
    
                    if(comments_open( get_the_ID() ))  {
                        comments_template('', true);
                    }
                endwhile;
    
                else :
                    get_template_part('post', 'noresults');
                endif;
            ?>
    
        </div><!-- #main-fullwidth -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  3. AlexSandager
    Member
    Posted 1 year ago #

    I get the sidebar, but it goes under the context. Can I in somehow move the context to the right, so the sidebar comes up on the left side of the context?

  4. vahidd
    Member
    Posted 1 year ago #

    Can you show me a online demo?

  5. AlexSandager
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic