How do I add another div inside the content div

Community Forums Forums Design Tips and Tricks How do I add another div inside the content div

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  ericoahu 9 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #47599

    ericoahu
    Participant
    Post count: 11

    What I have now:

    <div id-"content">
          <div id="post"></div>
         <div id="post"></div>
    </div><!--end content div-->

    What I want to do:

    <div id-"content">
         <div class="post-wrapper">
               <div id="post"></div>
               <div id="post"></div>
        </div><!--end post-wrapper class-->
    </div><!--end content div-->

    Eric Lauritzen

    Google+·app.net

    #47602

    Derek
    Participant
    Post count: 46

    Try this in your functions.php file:

    add_action( 'genesis_before_loop', 'extra_content_div_open');
    function extra_content_div_open() {
    ?>
    <div class="post-wrapper">
    <?php
    }
    
    add_action( 'genesis_after_loop', 'extra_content_div_close');
    function extra_content_div_close() {
    ?>
    </div> <!-- end .post-wrapper -->
    <?php
    }

    Derek Rippe – CSS Artist & Genesis Fanboy @ SynaVista and MediaCairn Design Studio
    Figure out your CSS problems with Firebug | Check out my Custom Comment Form Title plugin

    #47612

    ericoahu
    Participant
    Post count: 11

    Thanks Derek – much appreciated.


    Eric Lauritzen

    Google+·app.net

    #47620

    Derek
    Participant
    Post count: 46

    I actually could have written that a little better. Rather than closing and opening PHP, it’s probably better to use the “echo” command:

    add_action( 'genesis_before_loop', 'extra_content_div_open');
    function extra_content_div_open() {
    echo '<div class="post-wrapper">';
    }
    
    add_action( 'genesis_after_loop', 'extra_content_div_close');
    function extra_content_div_close() {
    echo '</div> <!-- end .post-wrapper -->';
    }

    Derek Rippe – CSS Artist & Genesis Fanboy @ SynaVista and MediaCairn Design Studio
    Figure out your CSS problems with Firebug | Check out my Custom Comment Form Title plugin

    #47677

    ericoahu
    Participant
    Post count: 11

    Excellent, again, much appreciated. I think I prefer the echo too.


    Eric Lauritzen

    Google+·app.net

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.