Forum Replies Created

Viewing 1 replies (of 1 total)
  • 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)

Viewing 1 replies (of 1 total)