Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

KarinMA on "Changing the loop"

$
0
0

Hi!

I have the code below that is set to pick up different cathegories. How can I change it to only search for category id=81 for example? I have tried different possibilities but can´t get this to work...

Thanks
/Karin

[please mark any posted code - http://codex.wordpress.org/Forum_Welcome#Posting_Code - the code below is partially broken by the forum parser]

<?php $current_num = $wp_query->current_post + 1; ?>

<?php if ( $wp_query->current_post == 0 ) {
	echo '
<li><ul class="shop-block-list">';
} elseif ( $wp_query->current_post % 3 == 0 ) {
	echo '</li>
<li><ul class="shop-block-list">';
} ?>

<li id="post-<?php the_ID(); ?>" <?php post_class("clearfix"); ?>>

	<div class="shop-block-img-wrapper">

		<?php if( has_post_thumbnail() ) { ?>
			<a>" rel="bookmark" title="<?php the_title_attribute(); ?>">
				<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'image-style3' ); ?>
				<?php echo '<img src="' . $src[0] . '" alt="" />'; ?>
			</a>

		<?php } else { ?>
			<a>" rel="bookmark" title="<?php the_title_attribute(); ?>">
				<?php echo '<img src="' . get_template_directory_uri() . '/images/image2.png" alt="" />'; ?>
			</a>
		<?php } ?>

	</div>

	<h4><a>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>

</li>
<?php if ( $current_num % 3 == 0 ) {
	echo '';
} elseif ( $current_num == $wp_query->post_count ) {
	echo '';
} else {
	//echo '';
} ?>

Viewing all articles
Browse latest Browse all 8245

Trending Articles