Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] Recent posts of same category, on single post pages


  #1  
Old Apr 30, 2009, 09:23 AM
GeoParadise
 
6 posts · Apr 2009
[SOLVED] Recent posts of same category, on single post pages

Hello again! When the user is reading a post (on a sigle post page) which belongs to one category, is it possible that the next/prev page navigation shows only posts inside the same category? Or, if not possible, would it be possible to have in the sidebar a list of all the other posts on that category?
Because, currently it shows the newer/older post of all categories making it difficult to navigate inside one category without having to go back again to the category multipost page. I hope the question make sense.
Again, our blog is:
www.geoparadise.org/blog
Thanks in advance!
NOA
  #2  
Old Apr 30, 2009, 02:37 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You can put this into a PHP code widget http://wordpress.org/extend/plugins/php-code-widget/

PHP Code:
<?php if ( is_category() ) {
global 
$wp_query;
$current_cat_id $wp_query->get_queried_object_id(); ?>
<div id="category-posts-<?php echo $current_cat_id?>" class="widget widget_recent_entries">
<div class="widget-title"><h3><?php single_cat_title('Recently in '); ?>:</h3></div>
<div class="widget-content">
<ul>
<?php global $post$cat_posts get_posts('numberposts=10&category='.$current_cat_id);
foreach(
$cat_posts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php ?>
  #3  
Old May 7, 2009, 10:12 AM
GeoParadise
 
6 posts · Apr 2009
Hello Flynn! Thanks for your answer.
I did it, but I canīt see any change at all!! What was supposed to be doing?

Noa
  #4  
Old May 7, 2009, 10:29 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
It should have listed the recent posts of the given category in the sidebar, when on a category page. Did you install the plugin? After that you should put one instance of the PHP code widget into a sidebar, and into the widget put the above code
  #5  
Old May 8, 2009, 03:13 PM
GeoParadise
 
6 posts · Apr 2009
Ok! Sorry, I was trying with the widget Php Code that comes with the theme, but now Iīve installed the plugin from your link and done everything again, and it certainly shows a list with the lasts posts of the category in the sidebar, like you said, but it does it in the Category MULTIPOST Page, which doesnīt give any extra functionality, as long as they are also listed in the center/main space.
What we would need and appreciate is to have that list/menu of the lasts entries on that category in the sidebar, but on the SINGLE Post Pages. (or otherwise, change the next/prev nav menu to show only post inside the category). I hope is possible...
Thanks again!
NOA
  #6  
Old May 8, 2009, 03:47 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Use this instead:
PHP Code:
<?php
if (is_single( )) {
$post_ID $wp_query->posts[0]->ID;
$all_cats_of_post get_the_category($post_ID);
$first_cat_ID $all_cats_of_post[0]->cat_ID;
$first_cat_name $all_cats_of_post[0]->cat_name;
?>
<div id="category-posts-<?php echo $first_cat_ID?>" class="widget widget_recent_entries">
<div class="widget-title"><h3>Recently in <?php echo $first_cat_name?>:</h3></div>
<div class="widget-content">
<ul>
<?php global $post$cat_posts get_posts('numberposts=10&category='.$first_cat_ID);
foreach(
$cat_posts as $post) : ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php ?>

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exclude category from Recent Posts in sidebar paulae Sidebars & Widgets 17 Apr 9, 2013 08:34 AM
Headline disappearing on single-post pages. Matt Butts New Versions, & Updating 6 Jul 11, 2009 09:15 AM
Footer on Single Post Pages > some of it is missing StudioGal Post-Kicker, -Byline & -Footer 10 May 8, 2009 12:31 PM
Static pages with category posts? mcphoto Atahualpa 3 Wordpress theme 3 Apr 25, 2009 09:48 AM
[SOLVED] How to show single post special category on static home page?? Shepherd Jim Post-Kicker, -Byline & -Footer 5 Mar 19, 2009 07:42 AM


All times are GMT -6. The time now is 12:59 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.