WordPress.org

Ready to get started?Download WordPress

Forums

Hannari
[resolved] How to display left sidebar after page content on mobile (3 posts)

  1. Gaerwn
    Member
    Posted 7 months ago #

    I am using a child theme. I have tried with the following code in the style.css of the child, but is not working:

    @media screen and (max-width:768px) {
    .left_sidebar .sidebar {
       float:right;
    }
    .left_sidebar .pagecontent {
       float:left;
    }
    }

    Any sugestion about what should I do to have the left sidebar displayed after page content on mobile?

    Thank you

  2. HostFat
    Member
    Posted 6 months ago #

    Hi

    Did you resolved it?
    I'm also interested on this :|

  3. Gaerwn
    Member
    Posted 6 months ago #

    Hi,

    I solved it by changing the template for Page: Left Sidebar in the child theme.

    1. Copy the Hannari file template-left-sidebar.php in the child-theme folder.
    2. Open the child theme file for editing and move the code for sidebar get_sidebar(); after the DIV element containing the page content.
    Instead of

    <div class="columnwrapp pagesidebar innerpage left_sidebar">
    	<?php get_sidebar(); ?>
    	<div class="pagecontent">
            	<?php if (have_posts()) :
            	/* ............ */
    		endif; ?>
    	</div>
    </div>

    you should have

    <div class="columnwrapp pagesidebar innerpage left_sidebar">
    	<div class="pagecontent">
            	<?php if (have_posts()) :
            	/* ............ */
    		endif; ?>
    	</div>
    	<?php get_sidebar(); ?>
    </div>

    and the left sidebar is displayed after page content on tablet and mobile.

Reply

You must log in to post.

About this Theme

About this Topic