WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Page Template Sidebar Below Content (6 posts)

  1. David686
    Member
    Posted 3 years ago #

    Hi

    Just started with WordPress and have successfully got a child template and alternative sidebar to work. Unfortunately sidebar shows below content. Sure that this is a CSS problem but cannot find the correct bit. Have called the child template alicsur1-page.php is this the problem? Problem persists if I revert to sidebar.php instead of the alternative.

    All suggestions welcome.

  2. kmessinger
    Volunteer Moderator
    Posted 3 years ago #

    URL please.

  3. David686
    Member
    Posted 3 years ago #

    Sorry would help: http://www.dogrejuv.co.uk

    Have narrowed problem down to file name. Welcome page which works OK is running off a child version of sidebar-page.php but About Us page, which has the problem, is running off alicsur1-page.php. Code in both pages identical.

    Suspect that I am doing something really stupid; but what?

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    Code in both pages identical.

    why do you use different files with identical code?

    the 'problem' lies in the way, Twenty Eleven deals with the sidebar formatting by adding the body_class .singular to templates without sidebar.
    for the 'sidebar-page.php' template, there is a part in the code that does not add the body_class .singular;
    in your child theme, you need to 'remove' this css class .singular for for any page templates that use the sidebar;

    example code:

    http://pastebin.com/HPsMqTRx

    (untested)

    ---
    btw: your front page also has display problems (at least in FF3.6) possibly caused by one or more of these validation errors:
    http://validator.w3.org/check?uri=http%3A%2F%2Fwww.dogrejuv.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

    http://codex.wordpress.org/Validating_a_Website

  5. David686
    Member
    Posted 3 years ago #

    Many thanks your code did the trick.

    By the way reason for identical code was to try and isolate the problem.

  6. itsbarry
    Member
    Posted 2 years ago #

    Filter worked great. Thanks alchymyth.

Topic Closed

This topic has been closed to new replies.

About this Topic