Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Maybe these classes are just created dynamically in the php and it is up to the dev if they want to define classes in the .css file.

    Bingo! That’s exactly it.

    Elements in CSS can have multiple classes–and they are indeed separated by whitespace. It just makes it easier to style things and to apply the exact formatting to any particular element but without having to create a whole new style for that element. Using the example you posted, your div is going to be styled according to the CSS rules from each of the classes attached to it, ie. “post-137”, “post”, “type-post”, etc. etc.

    To customize those classes, all you have to do is just manually add them to your stylesheet. For example, if you want all of your posts to look the same, define a CSS rule using a class that is common to all of the posts:

    .post {
        margin-top: 10px;
        font-weight: bold;
    }

    Now all of your divs with a “.post” class will have a top margin of 10px and the text will be bolded.

    This is my basic understanding of it, anyway…hopefully someone else will be able to shine more light on the subject. Additionally, you might want to do a Google search for “multiple CSS classes” or something along those lines…there’s lots of good reading out there.

    -Your ‘.hentry’ class has a 48px bottom margin.

    -‘#colophon’ in your footer has 18px top padding.

    -“#af-form-1649185636” has some bottom padding as well.

    Take those down and it should help bring everything closer together. I also see some stray < br >’s and dividers that you could probably get rid of as well.

    Thread Starter cjbee

    (@cjbee)

    And yes, the code you posted works fantastically too!

    Appreciate it!

    SOLVED 🙂

    Thread Starter cjbee

    (@cjbee)

    I will…although I just stumbled across another solution:

    ( adapted from: http://wordpress.org/support/topic/how-to-exclude-current-posts-from-2nd-loop?replies=3 )

    <?php
    global $wp_query;
    $thePostID = $wp_query->post->ID;
    $other_posts = get_posts('numberposts=5&exclude='.$thePostID.'&orderby=date');
     foreach( $other_posts as $post ) :?>
    
    <ul><li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li></ul>
     <?php endforeach; ?>
    Thread Starter cjbee

    (@cjbee)

    All it seems to be doing is spitting out the ID of the post at the top of the list:

    http://www.thirtylivegroup.com/images/screenshot2.jpg

    I see where you were going with it though…

    Thread Starter cjbee

    (@cjbee)

    No problem.

    Thanks again for all your help.

    Thread Starter cjbee

    (@cjbee)

    Yes! That works brilliantly. Thanks so much. But…

    What would I have to add if I want the POST ID in that code to reflect the POST ID of whatever post is currently being viewed?

    Thread Starter cjbee

    (@cjbee)

    That sidebar isn’t actually a sidebar…as in, not dynamic. I basically hard-coded the “other news” box within the XHTML, if that makes any difference.

    The code I’m using is essentially what I listed above:

    <div id="othernews">
                <div class="box">
                    <h3>Other News</h3>
                   <ul><?php get_archives('postbypost', '6', 'html', '', '', FALSE); ?></ul>
                </div>
            </div>

    That’s all I’m using to display that list of other posts.

    Thread Starter cjbee

    (@cjbee)

    Thanks, but it didn’t seem to do anything. 🙁

    Thread Starter cjbee

    (@cjbee)

    Here’s a link to a single post:

    http://www.thirtylivegroup.com/2011/02/30live-group-feature-band-aardvark-robinson/

    *Note: The “outernews” div referenced in the code I posted above was changed for clarity…on the actual site, that div is actually called “sidebar”.

    Thread Starter cjbee

    (@cjbee)

    Nope — not using any sidebar or widget on this page. The “other news” is just listed in a div that I added within the template:

    <?php get_header(); ?>
    <div id="page">
        <div id="page-inner" class="clearfix">
            <div id="othernews">
                <div class="box">
                    <h3>Other News</h3>
                   <ul><?php get_archives('postbypost', '6', 'html', '', '', FALSE); ?></ul>
                </div>
            </div>
            <div id="content">
                <?php if(have_posts()) : ?><?php while(have_posts())  : the_post(); ?>
                <div id="post-<?php the_ID(); ?>" class="post-content clearfix">
                    <h3 class="entry-title"><?php the_title(); ?></h3>
                    <?php include (TEMPLATEPATH . '/includes/postmeta.php'); ?>
                    <?php if (has_post_thumbnail()) {
                    $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail_name');
                    ?><a>" rel="shadowbox"><img class="postimg" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $thumb[0]; ?>&zc=1&w=625&h=400&q=100&a=c" alt="<?php
                    the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="entry clearfix">
                        <?php the_content(); ?>
                        <?php wp_reset_query(); ?>
                        <!-- <?php trackback_rdf(); ?> -->
                        <p><a href="history.go(-1)"><span class="arrow_back">Back</span></a></p><div class="divider"></div>
                    </div>
                    <div id="comments">
                        <?php comments_template(); ?>
                    </div>
                </div>
                <?php endwhile; ?>
                <?php else : ?>
                <?php endif; ?>
            </div>
            <?php get_footer(); ?>

Viewing 12 replies - 1 through 12 (of 12 total)