Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7

Thread: Div Issue

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    2
    Member #
    35441
    I can't get the sidebar div to go inside of the wrapper div for the single or pages of this site: http://theavocadogirl.com/2013/02/mock-refried-beans/

    This is what the code looks like, why is it loading differently?
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>The Avocado Girl</title>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Noticia+Text' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
    <?php wp_head(); ?>
    </head>
    <body>
    <header>
    <div class="wrapper">
    <div id="titlebar">

    <img id="logo" src="<?php bloginfo('stylesheet_directory'); ?>/images/avocado.png" width="102" height="112" alt="avocado girl" />
    <img id="title" src="<?php bloginfo('stylesheet_directory'); ?>/images/title.png" width="496" height="46" alt="TheAvocadoGirl.Com" />
    <div class="clear"></div>

    </div><!-- end titlebar -->
    </div><!-- end wrapper -->

    </header>
    <div class="wrapper">
    <div id="nav">
    <?php wp_nav_menu(array( 'menu' => 'mainnav', 'menu_class' => 'nav-bar-content', 'menu_id' => 'navigation', 'container' => false, 'theme_location' => 'primary-menu', 'show_home' => '1')); ?>
    </div><!-- end nav -->
    </div><!-- end wrapper -->
    <div class="wrapper">
    <div id="content">
    <?php get_header(); ?>

    <?php if ( ! have_posts() ) : ?>
    <h1>Not Found</h1>
    <p>Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post</p>
    <?php endif; ?>

    <?php while ( have_posts() ) : the_post(); ?>
    <div class="article">
    <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    <span class="date"><?php the_date(); ?></span>
    </a>
    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    <?php the_excerpt(); ?>
    <?php else : ?>
    <?php the_content('Read More'); ?>
    <?php endif; ?>
    <div class="meta">
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/tag.png" width="15" height="13" alt="tags" /><span class="tags"><?php the_tags(); ?></span>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/category.png" width="15" height="14" alt="categories" /><span class="categories"><?php the_category(', '); ?></span> </span>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/comments.png" width="20" height="15" alt="Comments" /><span class="comments"><?php comments_popup_link('Leave a comment', '1 Comment', '% Comments'); ?></span>
    </div>
    <?php comments_template( '', true ); ?>
    </div>

    <?php endwhile; ?>
    <div class="clear"></div>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    <div id="older-posts"><?php next_posts_link('Older Posts'); ?></div>
    <div id="newer-posts"><?php previous_posts_link('Newer Posts'); ?></div>
    <?php else: ?>
    <div id="only-page">No newer/older posts</div>
    <?php endif; ?>
    </div><!--end content -->
    <?php get_footer(); ?>

    <div id="sidebar">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("sidebar") ) : ?>
    <?php endif; ?>
    </div><!-- end sidebar -->
    </div><!-- end wrapper -->
    <?php get_sidebar(); ?>
    </div><!-- end sidebar -->
    </div><!-- end wrapper -->
    <div class="clear"></div>
    <footer>
    <div class="wrapper">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("footer") ) : ?>
    <?php endif; ?>
    <span id="copyright">Copyright &copy; 2013</span>
    </div><!-- end wrapper -->
    <?php wp_footer(); ?>
    </footer>
    </body>

    </code><a href="http://codepen.io/chibiwawa/pen/HLkCK">Check out this Pen!</a></pre>
    <script async src="http://codepen.io/assets/embed/ei.js"></script>

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Because it isn't inside the wrapper element. Count those </div>'s carefully.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    2
    Member #
    35441
    I know that's the problem! I'm just not seeing where the extra </div> is. That's why I'm trying to get another eye to look at it. If you could pinpoint where it is that would be helpful. Maybe copy and paste the code and point out where it needs to be corrected. Again, I get that there are too many </div>'s I just can't figure out where it is.

  5. #4
    Senior Member Andrew Yurlov's Avatar
    Join Date
    Apr 2011
    Location
    Portland, OR
    Posts
    1,306
    Member #
    27566
    Liked
    181 times
    It's very very very hard to spot because all the code is all aligned left.
    Artificial intelligence is nothing compared to natural stupidity -Someone

    Design is a funny word. Some people think design means how it looks.
    But of course, if you dig deeper, itís really how it works.
    -Steve Jobs



  6. #5
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Are you using any kind of editor ?

    DW highlights extra divs... Not sure about others

    I generally follow the same practice of using tab spacing for all my Divs ... So I can see at a glance... Each section ( or block ) of code...

    If the page goes over a couple hundred lines of code... Or starts getting complex .. I use comments on the closing div ... So I know which ones are associated with the opening div.

  7. #6
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Quote Originally Posted by Webzarus, post: 248483
    If the page goes over a couple hundred lines of code... Or starts getting complex .. I use comments on the closing div ... So I know which ones are associated with the opening div.
    Actually some of the closing tags for the divs are commented, but there is another issue.
    This is Wordpress, and some of the sections called by the PHP will have divs as well, and in some cases just the opening or, more likely, the closing tags - so that can throw off the count for the page as a whole.
    Anyway, it looks like you have it fixed now. Would you like to tell us how you did it?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  8. #7
    Banned
    Join Date
    Jan 2013
    Posts
    10
    Member #
    34731
    If your using dreamweaver you can easily collapse div's and tell where the problems are. Don't worry this is a common design issue that many of us face. You can also use w3c validation to test where the problem is. Also if your using firefox the firebug utility is a lifesave for finding these types of issues, you can see all the html generated even ones generated through wordpress like the user before said "sometimes wordpress has additional divs's hope this helps you out!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com