![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Guys, posting this in general, its a code based question. If anyone can throw a possible solution at it, that would be great.
I am trying to change this code to only display from category 5 (exclude categories 1,2,3,4) and only allow 10 posts from it. Just seeing if anyone can tell me what to edit, I tried a few things, that did not work. Here is the code for anyone that may think they can get it to work. I am assuming the edits need to be done on line 14 or 16? Code:
<?php get_header(); ?>
<?php
if (is_home()) {
include ('head_highlight.php');
include ('products_highlight.php');
}
include ('sidebar_home.php');
?>
<div id="main-content">
<div class="padd20">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-item clearfix">
<h2>"><?php the_title(); ?></h2>
<?php
if ( get_post_meta($post->ID,'thumb', true) ) {
$thumbwidth = get_option('fancytheme_thumb_width'); // thumbnail width
$thumbheight = get_option('fancytheme_thumb_height'); // thumbnail height
if ( $thumbwidth && $thumbheight ) {
?>
<a title="Permanent Link to <?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark">[img]<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, [/img]&h=<?php echo $thumbheight ?>&w=<?php echo $thumbwidth ?>&zc=1&q=80" alt="<?php the_title(); ?>" /></a>
<?php
}
}
?>
<h3>Posted on <?php the_time('l, F jS, Y') ?></h3>
<?php the_excerpt(); ?>
continue reading
</div>
<?php endwhile; ?>
<?php if (show_posts_nav()) : ?>
<div id="post-navigation" class="clearfix">
<span class="previous"><?php next_posts_link('Older Entries') ?></span>
<span class="next"><?php previous_posts_link('Newer Entries') ?></span>
</div>
<?php endif; ?>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
__________________
I See In CMYK | http://www.ChristianRishel.info | Graphic & Vector Design, Print Media |
|
#2
|
|||
|
|||
|
Hi,
Use query_posts to modify the database query (ie to modify the normal Loop). Add this: Code:
<?php query_posts("cat=5&showposts=10"); ?>
Code:
<?php if (have_posts()) : ?>
__________________
Ade Themessence - Studiograsshopper WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL! Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort. |
|
#3
|
|||
|
|||
|
Adew, worked like a champ, thank you very much.
__________________
I See In CMYK | http://www.ChristianRishel.info | Graphic & Vector Design, Print Media |
|
#4
|
|||
|
|||
|
Cool! :)
__________________
Ade Themessence - Studiograsshopper WordPress plugins: Dynamic Content Gallery | Reveal Page Templates | Custom Taxonomies Menu Widget Check out the Genesis and Child Theme tutorials before posting your question - and please provide YOUR URL! Make Andrea happy - read her Firebug tutorial and save yourself loads of time and effort. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excluding specific header tabs | Robert Barr | General Discussion | 7 | 05-02-2009 03:27 PM |
| Excluding posts from category archives | wifeunit | General Discussion | 1 | 01-12-2009 06:34 AM |
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us