nafarius1357 Posted August 14, 2009 Share Posted August 14, 2009 Hello all, this is small question I have to ask you: I am using Featured categories plugin on my Wordpress theme And there is a code which I need to edit: <span class="wpn_fheading">Featured Content</span> <ul class="wpn_featuredc"> <!-- START Featured Category 1 // Edit cat=43 below to the category ID you wish to display --> <?php $recent = new WP_Query("cat=20&showposts=1"); while($recent->have_posts()) : $recent->the_post();?> <li> <span class="wpn_fcat_thumb"> <a href="<?php the_permalink() ?>" rel="bookmark"> <img alt="<?php the_title(); ?>" src="<?php echo get_post_meta($post->ID, "featured-category", true); ?>" width="170" height="90" /> </a> </span> <span style="clear:both;"></span> <a href="<?php the_permalink() ?>" rel="bookmark"> <?php featured_content_title(); ?> </a> <span class="wpn_comments"> <?php comments_popup_link('No Comments', '1 Comment', '% Comments' );?> </span> <a class="wpn_readmore" href="<?php the_permalink() ?>">Read More</a> </li> <?php endwhile; ?> <!-- END Featured Category 1 --> Everything is fine if I change that cat=43, but reason is I changed website permalinks to SEO Friendly like: i-need-help and now I don't know how write them now in that code. Can anyone help me with this? Thanks Link to comment https://forums.phpfreaks.com/topic/170229-help-with-wordpress-plugin/ Share on other sites More sharing options...
Bricktop Posted August 14, 2009 Share Posted August 14, 2009 Hi nafarius1357, Not sure how your URLs look but normally: cat=20&showposts=1 Would translate to something like: /category/20/showposts/1 Just load up the article you wish the script to show and take a note of its URL in the browser address bar, then replicate that in the code above and it should work OK. Hope this helps Link to comment https://forums.phpfreaks.com/topic/170229-help-with-wordpress-plugin/#findComment-897976 Share on other sites More sharing options...
nafarius1357 Posted August 14, 2009 Author Share Posted August 14, 2009 I've tried to play with it. maybe it will help you if I'll show my blog: www.gamershall.co.uk please have a look at categories and you probably understand how they should transform. P.S it must come up into that featured content boxes there are 3 of them. Many thanks! Link to comment https://forums.phpfreaks.com/topic/170229-help-with-wordpress-plugin/#findComment-897981 Share on other sites More sharing options...
Bricktop Posted August 14, 2009 Share Posted August 14, 2009 Ok, so I looked at http://www.gamershall.co.uk/category/games/games-reviews/ which I'll use an an example. If you change the line of code in your script from: <?php $recent = new WP_Query("cat=20&showposts=1"); while($recent->have_posts()) : $recent->the_post();?> to: <?php $recent = new WP_Query("category/games/games-reviews/"); while($recent->have_posts()) : $recent->the_post();?> This should work and display the game reviews ctaegory. However, we're missing the bit of code which limited the results to only display one item (&showposts=1). I'm not sure how your SEO script handles this request, maybe something like category/games/games-reviews/limit/1 or category/games/games-reviews/show/1, this is something you will need to look into but from my code example above you should be able to work out where to stick the extra code once you've found it. Hope this helps. Link to comment https://forums.phpfreaks.com/topic/170229-help-with-wordpress-plugin/#findComment-897983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.