i have a post pod called kenya_safaris
and a category pod called safari_category
i have this in my archive.php
<?php
$selected = pods_url_variable(-1);
$pods= new Pod(‘kenya_safaris’);
$params[‘select’] = ‘*’;
$params[‘orderby’] = ‘t.name’;
$params[‘limit’] = 25;
$params[‘where’] = ‘category.name LIKE “‘.$selected.'”‘;
echo $pods->find( $params )->template( ‘Safari_Template’ );
?>
is there anything that i am doing wrong? coz i cant display post per category
Use the WordPress API and templating structure, it’s the easiest way to theme.
See: http://codex.wordpress.org/Creating_an_Archive_Index#The_Template_.28archives.php.29
Hey Scott Thanks for your help, I actually noticed that my problem was displaying custom fields in archive pages. I have managed to display the title and summary but i am having some problems with the image. My code in archive.php loop is:
<h4 class="excerpt-title"><a>"><?php echo get_the_title(); ?> </a></h4>
<?php $postimageurl = get_post_meta($post->ID, 'tiny_pic', true);
if ($postimageurl) {
?>
<a>" rel="bookmark"><img src="<?php echo $postimageurl; ?>" alt="Post Pic" class="tinyPic " width="150" height="150" /></a>
<?php } else { ?>
<a>" rel="bookmark"><img src="<?php bloginfo('template_url'); ?>/images/wprecipes.gif" class="tinyPic" alt="Screenshot" width="150" height="150" /></a>
<?php } ?>
<div id="summary"><?php echo get_post_meta($post->ID, 'summary', true); ?></div>
<div id="readmore"><a>">Read More</a></div>
My image is in a custom field pod
I only have the image frame but it is not displaying the image. Pliz assist on this.
You could try using this instead when you output it:
<?php echo pods_image_url( $postimageurl, 'thumbnail' ); ?>