treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Various Design Issues

  • I am having several problems. Here is my website. Okay, so I am trying to create something like this.

    First off, several things that have been ordered to float: right; are not actually floating right. The part that states the author and date, post-info right, and the stated category, category-menu, are not on the right side of the page. But category-menu looks like it might be floating right, I may just need to change the positioning. But post-info right is most certainly not doing what I want it to.

    That is the first issue. Let us figure out that first before I go any further. Thank you in advance!

  • Seem to be floated right to me (or positioned absolutely as it seems). You probably want to use text-align: right; to align text. Float moves just the element, it doesn't touch text inside the element.

    Edit!

    Take position: absolute; away on some of the floated elements. Elements that are absolutely positioned cannot be floated.

  • @Merri: Yay! I'm an idiot. Yep, text-align indeed did what I was trying to do with float. Sigh. Thank you. Also, I removed position: absolute; on .category-menu and then I gave it padding-left: 300px;, but if you know of a better way to position it, I am up for suggestions.

    Okay, problem #2. When you view a page using single.php like this one, all of the content gets thrown to the left side. The code is pretty much the same on every page, so I opened up single.php, and this is all it is:

    <?php
      /**
       * The Template for displaying all single posts
       *
       * Please see /external/starkers-utilities.php for info on Starkers_Utilities::get_template_parts()
       *
       * <a href="/forums/profile/package">@package   WordPress
       * @subpackage  Starkers
       * @since     Starkers 4.0
       */
      ?>
    <?php Starkers_Utilities::get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header' ) ); ?>
    
          <div id="main-content">
    
            <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
    
            <article>
              <?php the_post_thumbnail( 'full' ); ?>
              <h2><?php the_title(); ?></h2>
              <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_date(); ?> <?php the_time(); ?></time> <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>
              <?php the_content(); ?>     
    
              <?php if ( get_the_author_meta( 'description' ) ) : ?>
              <?php echo get_avatar( get_the_author_meta( 'user_email' ) ); ?>
              <h3>About <?php echo get_the_author() ; ?></h3>
              <?php the_author_meta( 'description' ); ?>
              <?php endif; ?>
    
              <?php comments_template( '', true ); ?>
    
            </article>
    
            <?php endwhile; ?>
    
          </div> <!-- end main-content -->
    
    <?php Starkers_Utilities::get_template_parts( array( 'parts/shared/html-footer','parts/shared/footer' ) ); ?>
    

    Everything looks fine to me, but obviously something is not working. Any help would be greatly appreciated.

  • Your .single {} class is floated left and has width of 430px.

    Line 458 in your style.css.

  • Oh, I see. Oops. I named one of my post types "single" as well. I knew it became broken when I hauled over the new code, I just did not know where I went wrong. Thank you, @AlenAbdula. Life-saver.