ThemeShaper Forums » Thematic

[closed]

Remove sidebar and replace with content

(5 posts)
  • Started 9 years ago by willforsyth
  • Latest reply from willforsyth
  • This topic is not resolved
  1. Hi all

    I am new to child themes and wordpress themeing and themshaper has been an excellent resource. I am trying to remove my sidebar from my child theme and replace with content.

    What I gather is the best way to do it is to use a function to remove the sidebar.

    function remove_sidebar() {
    remove_action('thematic_sidebar');
    }
    add_action('init','remove_thematic_sidebar');

    add_action('thematic_sidebar');

    Then place content back in to this section with

    function remove_sidebar()
    {?>
    <div class="about me"><h2>about me</h2><p>blah blah blah</p></div>
    <div class="skills"><h2>about me</h2><p>blah blah blah</p></div>
    <?php }
    add_filter('remove sidebar');

    I know most of the code with be wrong (gave it my best shot) but am I going down the right lines?

    thanks

    Posted 9 years ago #
  2. I'm pretty sure you won't be able to have 2 functions named the same. That seems to produce fatal errors when I try it. If you don't want any widgets ever in the sidebar (just your divs) try this instead:

    function my_sidebar() { ?>
    <div class="aboutme aside main-aside"><h2>about me</h2><p>blah blah blah</p></div>
    <div class="skills aside main-aside"><h2>about me</h2><p>blah blah blah</p></div>
    <?php
    
    }
    add_filter('thematic_sidebar', 'my_sidebar');

    or if you'd like to hang on to the widget areas (you don't have to use them) and just want to drop your divs in on top of them try hooking onto the abovemainasides hook:

    function my_sidebar() { ?>
    <div class="aboutme aside main-aside"><h2>about me</h2><p>blah blah blah</p></div>
    <div class="skills aside main-aside"><h2>about me</h2><p>blah blah blah</p></div>
    <?php
    
    }
    add_action('thematic_abovemainasides', 'my_sidebar');
    Posted 9 years ago #
  3. thank you so much.

    So I dont need to remove the sidebar to insert a replacement div.

    I will try this tonight when I get home.

    It takes a while to get your head around whats going on. fingers crossed I have a moment of clarity soon.

    Posted 9 years ago #
  4. No you don't need to remove it... Atleast both of those snippets worked for me. Give them a shot and let us know if they work or not.

    And I think it is normal for something as powerful as thematic to have a decent learning-curve.. so don't get down about that.

    Posted 9 years ago #
  5. tried that last night and it worked a treat thanks so much.

    did you have any resources/sites where your mastered filters and hooks for thematic?

    thank you very much for the help

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.