Categorizing my header post
-
Hi guys
Im having a problem with my theme main post in my header…
My website: http://www.feelinspired.co.za
Now if you look at the Main post.. i would like it to be catgorized to only show posts from my portfolio category (3) and NOT my blog posts which are under a different category. Now my coding skills arent up to scratch with PHP so if anyone could help me adjust the code it would be great :)
This is my home.php Where the code is located…
<?php get_header(); ?>
<?php if ( $paged < 1 ) {?>
<!– Begin static –>
<?php $my_query = new WP_Query(‘showposts=1’); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>
<div class=”post-<?php the_ID(); ?> static-image-wrapper”>
<?php echo get_the_image_link(array(‘image’,’My Image’),’medium’); ?>
<div class=”title-overlay”><h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title() ?></h2>
<?php the_excerpt(); ?>
<p class=”postmetadata”><?php the_time(‘M d, Y’) ?> | <?php comments_popup_link(‘Have your say »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
</div>
</div>
<?php endwhile; ?>
<?php }?><?php $i = 0; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); $i++; ?>
<div class=”span-8 post-<?php the_ID(); ?><?php if ($i == 3) { ?> last<?php } ?>”>
<h6 class=”archive-header”>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title() ?></h6>
<?php echo get_the_image_link(array(‘thumbnail’,’thumbnail-news’),’thumbnail’); ?>
<?php the_excerpt(); ?>
<p class=”postmetadata”><?php the_time(‘M d, Y’) ?> | <?php comments_popup_link(‘Have your say »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
</div>
<?php if ($i == 3) { ?><div class=”archive-stack clear”></div><?php $i = 0; } ?>
<?php endwhile; endif; ?><div class=”clear”></div>
<div class=”navigation”>
<div><?php next_posts_link(‘« Older Entries’) ?></div>
<div><?php previous_posts_link(‘Newer Entries »’) ?></div>
</div><?php include (TEMPLATEPATH . “/bottom.php”); ?>
<?php get_footer(); ?> -
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for WordPress.com hosted blogs only. If you have a self-hosted WordPress blog you need to seek help at the WordPress.org forums, not here.
If you don’t understand the difference, you may find this information helpful.
- The topic ‘Categorizing my header post’ is closed to new replies.