ThemeShaper Forums » Thematic

Placing the header into a sidebar

(5 posts)
  • Started 4 years ago by killtheliterate
  • Latest reply from amygail
  • This topic is not resolved

Tags:

  1. I've just begun working on a child theme for Thematic. A very new experience. I've built themes before with sandbox, but this is new and terrifying.

    i'm trying to create a blog with a fixed position sidebar, and would like the header info to display in this sidebar. any help moving the header into a sidebar?

    Posted 4 years ago #
  2. Zombaya
    Member

    Well, you'll have to make a custom header.php in you child-theme-directory which does not display the header-information. You could make this into:

    <?php thematic_create_doctype(); echo " "; language_attributes(); echo ">\n";?>
    <head profile="http://gmpg.org/xfn/11">

    <?php

    thematic_doctitle();
    thematic_create_contenttype();
    thematic_show_description();
    thematic_show_robots();
    thematic_canonical_url();
    thematic_create_stylesheet();
    thematic_show_rss();
    thematic_show_commentsrss();
    thematic_show_pingback();
    thematic_show_commentreply();

    wp_head(); ?>

    </head>

    <body class="<?php thematic_body_class() ?>">
    <?php thematic_before(); ?>

    <div id="wrapper" class="hfeed">

    <div id="main">

    Then you'll have to add that information to your sidebar. To do this add the following to your functions.php:

    <?php
    function add_sidebar_header() { ?>
    <?php thematic_aboveheader(); ?>

    <div id="header">
    <?php thematic_header() ?>
    </div><!-- #header-->

    <?php thematic_belowheader(); ?>
    <?php } ?>

    <?php add_action ( 'thematic_abovemainasides', 'add_sidebar_header' ); ?>

    If all goes well, then your header should be within your sidebar. There could be an error in the code since I'm just writing it as it comes up, haven't checked it. The idea behind my solution is to remove the header above the content and to add it with a function to the hook thematic_abovemainasides.

    Posted 4 years ago #
  3. amygail
    Member

    Why not just change the position of the header via css?

    Posted 4 years ago #
  4. i just placed <?php thematic_header() ?> in the childtheme sidebar.php

    Posted 4 years ago #
  5. amygail
    Member

    That works visually, but if you look at your source code, all of your content comes before your branding, menu etc.
    This can cause some issues with seo and accessibility (screen readers, mobiles, etc)
    For comparison go to http://themeshaper.com/ and look at the source code (or better, disable css in your browser - do the same with your site and see the difference..

    The visual effect you've got would be pretty easy to accomplish with css.

    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.