milascisolo
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Themes and Templates
In reply to: How to style latest post AND recent posts differently?poppacket, thank you very much, as chedonline said great solution.
<div id="rightcol"> <?php // this is where you enter the IDs of which categories you want to display $display_categories = array(5,6,7); foreach ($display_categories as $category) { ?> <div class="clearfloat"> <?php query_posts("showposts=1&cat=$category"); $wp_query->is_category = false; $wp_query->is_archive = false; $wp_query->is_home = true; ?> <h3><a href="<?php echo get_category_link($category);?>"><?php // this is where the name of each category gets printed single_cat_title(); ?></a></h3> <?php while (have_posts()) : the_post(); ?> <?php // this grabs the image filename $values = get_post_custom_values("Image"); // this checks to see if an image file exists if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" /></a> <?php } ?> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php // this is where title of the article gets printed the_title(); ?>»</a> <?php the_excerpt(); ?> <?php endwhile; ?> </div> <?php } ?> </div><!--END RIGHTCOL-->but i still have a problem. as i am not so into wp, i couldn’t port it to this code.
i know this will be too much but can you help?
thanks :$
edit:
I’m trying to solve this problem but getting a T_ELSE error on line 65 which is
<?php else: ?>Here is the code i’m trying to replace the old right column with yours
<div id="rightcol"> <div class="clearfloat"> <?php query_posts("showposts=4&offset=1"); // show 4 latests posts excluding the latest ?> <h3><a href="<?php echo get_category_link($category);?>"><?php // this is where the name of each category gets printed single_cat_title(); ?></a></h3> <?php while (have_posts()) : the_post(); ?> <?php // this grabs the image filename $values = get_post_custom_values("Image"); // this checks to see if an image file exists if (isset($values[0])) { ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="" /></a> <?php } ?> <a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php // this is where title of the article gets printed the_title(); ?>»</a> <?php the_excerpt(); ?> <?php endwhile; ?> <?php else: ?> <!-- Error message when no post published --> <?php endif; ?> </div> <?php } ?> </div>I still couldn’t make it to show the category name and title.
Viewing 1 replies (of 1 total)