oli_collins
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Fixing WordPress
In reply to: get_posts category not workingok my code is now shown below and it shows no posts but its not relatest the setup_postdata($pst); line as it was like that before i just put that in:
<? $latestPost=get_posts('numberposts=3&category=-3'); foreach($latestPost as $pst){ setup_postdata($pst);?> <? $custom_fields = get_post_custom($pst->ID); /*print_r($custom_fields);*/ $post_category = get_the_category($pst->ID); ?> <li><a href="<?php bloginfo('url'); ?>/<?=$post_category[0]->category_nicename;?>/<?=$pst->post_name;?>/"><span><?=$pst->post_title?></span><br /><?php echo $custom_fields['Location'][0]; ?><? if($custom_fields['Salary'][0]!=''){?><br /><span><? echo $custom_fields['Salary'][0]; ?></span><? } ?></a></li> <? } ?>Forum: Fixing WordPress
In reply to: get_posts category not working<? $latestPost=get_posts('numberposts=2&category=3'); foreach($latestPost as $pst){?> <? $contentAge=$pst->post_content; $contentAg=substr($contentAge,0,57); ?> <? $custom_fields = get_post_custom($pst->ID); $post_category = get_the_category($pst->ID); ?> <li><a href="<?php bloginfo('url'); ?>/<?=$post_category[0]->category_nicename;?>/<?=$pst->post_name;?>/"><?=$pst->post_title?></a><br /><?=$contentAg?>...<br /><div class="more"><a href="<?php bloginfo('url'); ?>/<?=$post_category[0]->category_nicename;?>/<?=$pst->post_name;?>/">More...</a></div></li> <? } ?>As per my initial post I have tried using category but there were still problems with it
Viewing 2 replies - 1 through 2 (of 2 total)