Jump to content
Sign in to follow this  
mpeesel

I'd like to exclude specific categories form the footer sections called "The Latest"

Recommended Posts

mpeesel

"The Latest" section in: wp-content/themes/platformpro/sections/sidebars/section.footcols.php automatically loads recent posts form all categories. I'd like to exclude some categories from this list. Might anyone have an easy way to do this? Here's the section of code:

<?php _e('The Latest','pagelines');?>

  • <?php foreach(get_posts('numberposts=3&offset=0') as $key => $post): setup_postdata($post);?>
  • <?php echo $post->post_title; ?>
    <?php echo ( !is_404() ) ? custom_trim_excerpt(get_the_excerpt(), 12) : ''; ?>
    <?php endforeach;?>
Thanks!

Share this post


Link to post
Share on other sites
Rob
You could do that OR, you could use a plugin to create a custom list by shortcode that excludes the categories, this way you don't affect other uses of the generic list that may be applicable elsewhere. Alternatively at http://www.epicurusinstitute.org/ (bottom of the page in boxes) I use a combination of a PHP script and a plugin called Shortcode Exec PHP. It could include a customized list that has only the categories you wish to show. On my site, each of three categories is set to show 5 posts. I could adjust it to almost any configuration. If you'd like me to post that PHP code I'd be happy to do so. Let me know your preference.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Simon
To ignore cat 39 and 15 [code] $post): [/code]

Share this post


Link to post
Share on other sites
mpeesel
Thanks to both of you for your answers! Pross, yours was easy and quick and worked like a charm. Thanks!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×