WordPress.org

Ready to get started?Download WordPress

Forums

Displaying only 1 Category on a page. (3 posts)

  1. michaellarge214
    Member
    Posted 3 years ago #

    I have been trying to find a definite answer to ONLY display content from a specific category on a page. Like...anything in the "Blog" category will display on the "Blog" page. Does anyone know who I could do this? forgive me, while i have a knowledge of html and css I dont know PHP very much. Thanks!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'News',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    http://codex.wordpress.org/Function_Reference/query_posts

  3. michaellarge214
    Member
    Posted 3 years ago #

    Forgive me, I am very new to wordpress concepts and coding. Where would I apply this code?

Topic Closed

This topic has been closed to new replies.

About this Topic