ruzzino
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Show a post list of current categoryMichael, It’s Incredible! it’s working correctly now!
I matched several solutions I found in this forum and now I don’t know why it works now!
I found one of your post in a forum, and… the mistery:<?php global $post; if(is_category() || is_single()){ foreach(get_the_category() as $category) { $current = $category->cat_ID; $current_name = $category->cat_name; //query_posts("cat=". $current); $myposts = get_posts(array('category__in' => array($current))); //$myposts = get_posts('numberposts=50&category='.$current); //query_posts(array('category__in' => array(11))); } } foreach($myposts as $post) : setup_postdata($post); ?> <li> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a> </li> <?php endforeach; ?>
thanks a lot for your care!
MarcoForum: Fixing WordPress
In reply to: Show a post list of current categoryForum: Fixing WordPress
In reply to: Show a post list of current categorydear Michael, sorry for my english.
Have you got a moment for me, again?My first problem, I think, is that the structure of the categories is made of parents and many children.
Infact the code, in the sidebar, works correctly when the current post is the last children category , but doesn’t work when the post is in a parent category with some children.
And then it shows me the posts of that category and the posts of the category child. Too many posts.And then my question is:
is there a way to exclude the children by the current category?thanks in advance, again!
MarcoForum: Fixing WordPress
In reply to: Show a post list of current categorythanks a lot MichaelH!
MarcoForum: Fixing WordPress
In reply to: Show a post list of current categoryMichaelH, thanks a lot for your reply, but it doesn’t work correctly yet.
How can I exclude parent and child categories of every current category?What do you think?