Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The following is not working to call posts from a specific category and only grab the number of posts selected.

I'm using more than one loop on a page as I am using this to create a "featured content" section on my homepage.

    <?php
    ('cat=111&posts_per_page=1');
    if (have_posts())
    ?>
    <?php while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You're not actually running any queries. Need to run wp_query(), query_posts() or get_posts(). All are covered in great detail within the codex. Though you already have your parameters listed up ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.