Support » Developing with WordPress » Show tags and posts for a selected category.

  • Hi,

    I would like to generate a Tag Cloud on my static home page which contains only the tags of a given category. I was thinking something along the lines of:

    wp_tag_cloud(‘category=news’);

    Is it possible?

    What’s the best method of showing the most recent posts of a given category?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I would like to generate a Tag Cloud on my static home page which contains only the tags of a given category.

    Yikes.

    I know of nothing at present which does this, so what you’re looking at is having to create a (complicated, but doable) query that would collect those tags.

    What’s the best method of showing the most recent posts of a given category?

    Just visit the category. Or is this a trick question? ;)

    Thread Starter skina

    (@skina)

    Thanks for the reply.

    I’ll have a crack at that query and let you know how I get on.

    The second question wasn’t a trick but I figured it out (actually, I read the documentation properly). All I needed to do was:

    $postslist = get_posts('category=7&numberposts=10&order=DESC&orderby=post_date');
            if (true === !is_array($postslist)) :
                ?><li>No Posts</li><?
            else : foreach ($postslist as $post) :
                setup_postdata($post);
                ?><li><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a></li><?
            endforeach;
            endif;

    The above code shows the 10 most recent posts from my selected category (id=7) on my sidebar (i.e. on any page on the site)

    wp_tag_cloud('category_name=news');

    It would be a Excellent function if it exist! Unfortunately it’s not!
    Waiting for this to happen too.. 🙂

    Meanwhile the solution I know is using this pluginhttp://thedeadone.net/software/tdo-tag-fixes-wordpress-plugin/
    It works in my test with WP 2.5

    wp_tag_cloud('category_name=news'); Yes! I WANT THIS!

    I’d also like to see this function, anyone able to build a plugin that would allow it?

    +1 for this

    Me too!

    Sounds like a simple and great function that should be added.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show tags and posts for a selected category.’ is closed to new replies.