ThemeShaper Forums » Thematic

[closed]

adding a full width <div> before the main content...thematic_belowheader()

(8 posts)
  • Started 5 years ago by lqunta
  • Latest reply from lqunta
  • This topic is not resolved
  1. lqunta
    Member

    Hi Guys,

    I'm having a problem here. I would like to add a full width div [within which, I plan to incorporate other features [e.g. A Slideshow / Plugin - Featured Content Gallery, and Call To Action buttons - http://forums.themeshaper.com/topic/custom-layout-with-child-theme] ] just before the main content on the HOME page only...should not appear on all the other pages.
    -How can I achieve that?
    -Will I have to edit the thematic_belowheader() function? Any pointers here...

    Cheers
    LQunta

    NB: Full Column Width = Spanning the entire width of the site, effectively pushing the side-bar down.

    Posted 5 years ago #
  2. Not sure about my code and where exactly it will pop up below the header, but try this in functions.php to get your div smuggled in

    // Adds some extras below the header
    function childtheme_belowheader_extras() { ?>
        <div id="belowheader_extras">
    
            ...your slideshow...
    
        </div>
    <?php }
    add_action('thematic_belowheader','childtheme_belowheader_extras');

    And this in your style.css to make your div invisible to the browser if the page is not home

    body.singular #belowheader_extras,
    body.category #belowheader_extras,
    body.search-results #belowheader_extras {
        display:none;
    }
    body.home #belowheader_extras {
        display:inherit;
    }
    Posted 5 years ago #
  3. No need to hide code that you can keep from executing in the first place. Why not use the condition is_home()

    function childtheme_belowheader_extras() {
    if (is_home()) { ?>
        <div id="belowheader_extras">
    
            ...your slideshow...
    
        </div>
    <?php }
    }
    add_action('thematic_belowheader','childtheme_belowheader_extras');

    -Gene

    Posted 5 years ago #
  4. Thanks Gene!

    Posted 4 years ago #
  5. lqunta
    Member

    Greetings Gene, Manuel,

    Well, I've tried the above code, and seem to be stuck again.

    Well, if I put my slideshow [FCG - Featured Content Gallery], on it's own, it shows, but, if I put all the content, then, I get back to the stone age [nothing shows].

    I'm putting the FCG code, and, below this, four 'box/ wiget style' - action boxes [basically a glorified way of saying, a text header, 5 letter description, and a button] below this. Any tips here?

    Cheers
    LQunta

    Posted 4 years ago #
  6. I'm putting the FGG code (…) below this. Any tips here?

    You have to replace “...your slideshow...” with your code.

    function childtheme_belowheader_extras() {
    if (is_home()) { ?>
        <div id="belowheader_extras">
    
            ...your slideshow...
    
        </div>
    <?php }
    }
    add_action('thematic_belowheader','childtheme_belowheader_extras');
    Posted 4 years ago #
  7. Your probably having issues combining php and html in your function. Post the code you've been working on.

    Posted 4 years ago #
  8. lqunta
    Member

    Greetings Gene,

    Sorry for taking rather long to respond to your request. Have been offline a little as I was sorting out other issues.

    In response to your query, below is the code that's in my functions.php file

    //
    // Add some extras below header - Leader Board
    //
    
    function masina_adventures_leaderboard() {
      if (is_home() || is_front_page()) { ?>
          <div id="leader">
    
    		<div id="leader_top">
    			<div id="slideshow">
    				<?php include (ABSPATH . ‘/wp-content/plugins/dynamic-content-gallery-plugin/dynamic-gallery.php’); ?>
    			</div>
    
    			<div id="actions">
    				..... action buttons here ....
    			</div>
    		</div>
    		<div id"leader_bottom">
    			<div id="action_box_1">
    				..... action box content ....
    			</div>
    			<div id="action_box_2">
    				..... action box content ....
    			</div>
    			<div id="action_box_3">
    				..... action box content ....
    			</div>
    			<div id="action_box_4">
    				..... action box content ....
    			</div>
    		</div>
    
    	  </div>
    <?php
      }
    }
    add_action('thematic_belowheader','masina_adventures_leaderboard');

    The effect is that, everything is appearing below the other. The slide show too does not show, despite being properly configured.

    Cheers
    LQunta

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.