nbz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: The Loop problemsSorry, my mistake. I even looked at that page. Blame my stupidness.
Forum: Fixing WordPress
In reply to: The Loop problemsThanks, that worked.
It was something I really did not know. Is this documented in the Codex?
Forum: Fixing WordPress
In reply to: How to show static page titleAnyone?
Forum: Your WordPress
In reply to: The Revival WebsiteThanks.
It is unique. I hope. It did take a long ime to design though. Trying diferent things to see what worked was frustrating. No doubt other know how it can result in forced hair loss! (well not really, but you get the idea).
It does not have the same obvious attention to details as your site (which is also fab), but that was one of the things I wanted – something that hid the complexity.
Forum: Fixing WordPress
In reply to: Do not show posts for a category on indexI have found the answer!
<?php query_posts('cat=1'); ?>Just before the loop, and only items from category 1 and its subcategories will display!
Forum: Plugins
In reply to: WordPress show a post for each categoryI have got a working version now!
I will post a simplified version of what I have done (so as not to scare people away; in my code I have a hackish loop to divide the categories into two columns…)
<?php$categories = array(1, 2, 3, 4,);
foreach($categories as $categ){
setup_postdata($post);
$posts = get_posts('numberposts=1&category='.$categ);
foreach($posts as $post) :
?>
<div><?php the_category(', ') ?>
<li><a href="<?php the_permalink(); ?>" title="Link to <?php the_title(); ?>"><?php the_title(); ?></a></li></div><?php endforeach;
}?>Forum: Plugins
In reply to: WordPress show a post for each categoryTo list 1 post from category use:
<ul>
<?php
$posts =get_posts('numberposts=1&offset=1&category=4');
foreach($posts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
(Read more on Codex)Now I just need to add something before that to search for a category, and then automatically place it in the category= bit… any ideas?
Forum: Plugins
In reply to: WordPress show a post for each categoryhmmm… not got any replies. I’ll guess the coe above put people off!
What I want to do is simple really:
1. Find all the categories.
2. For each category find latest post.
3. Print the category title followed by the title of the post.The code above (just ignore it) is the other way around: It finds latest posts and then sorts them into categories.
I have not been able to find out how to find all categories. there is list_cats, but that just prints all categories instead of putting them in a variable to use…