Feature Box with single post from designated category

Sometimes you need to throw something up front and center for all the world to see. Leave your pants on, Mazz, I’m talking about blog posts.

/* populates feature box with latest post excerpt :: change category name to taste*/

function featurecontent() { ?>

<div id=”my-feature-box”>

// start loop with query for specific category of post & desired number to display
<?php $my_query = new WP_Query(‘category_name=video&showposts=1′); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?>

// set title of displayed post to display as h2 and supply permalink to full article
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></a></h2>

// display the content or change to the_excerpt if desired
<?php the_content(); ?>

// offer link to the rest of the article if using an excerpt
<div class=”featurereadmore”>
<a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Read the full article”>Read the full article &rarr;</a>
</div>

// end the loop
<?php endwhile; ?>
</div>
<?php
}

add_action(‘thesis_hook_feature_box’, ‘featurecontent’);

Posted in Snippets | Leave a comment

Footer mania continues

Maybe I mentioned this elsewhere, but what the hell, here is is again. To add a clone of the top nav, just do this:

/* Remove Thesis attribution, add footer nav */
remove_action(‘thesis_hook_footer’, ‘thesis_attribution’);
add_action(‘thesis_hook_footer’, ‘thesis_nav_menu’);

Posted in Snippets | Leave a comment

Look! Another Footer!

Hot on the heels (heels! footer! haha!) of yesterday’s footer post, here’s a better way to code it, using an unordered list so it’s semantically correct:

// Custom footer
add_action('thesis_hook_footer', 'custom_footer');

function custom_footer() {
?>
<div id="footer_right">&copy; < ?= date( 'Y' ) ?>, Company name &bull; site by HDG, inc.</div>
<div id="footer_left">
<ul class="menu">
<li>HOME</li>
<li>About us</li>
<li>Services</li>
<li>News</li>
<li>Affiliations</li>
<li>Contact Us</li>
</ul>
</div>
< ?php
}

Posted in Snippets | Leave a comment