WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My site has Genesis framework and a child theme. I want to show specific category posts on my home page content area. I used the simple post query


in my genesis/lib/structure/loops.php file right above the do_action( ‘genesis_before_post’ );, but it makes no sense . So at last I used this grid loop but using this I am still unable to show category specific posts on home page as it is not taking the category attribute.

The main problem is this: by clicking on a particular post link the post doesn’t open on a separate page it redirects to the same page.

share|improve this question
First - Do not alter the core. Second - These links may help you with what you need to achieve. – vajrasar Feb 4 '13 at 13:02

Also using query_posts() is highly discouraged. If you need a second loop, use new WP_Query() or if you want to adjust the main loop then use pre_get_posts. If you home page is not a static page, then this should work regardless of what theme you use. (Goes in functions.php... preferably a child theme if you are working with a framework)

function wpa84417_include_cat( $query ) {
    if ( is_home() && is_main_query() ) {
        set_query_var( 'cat', '33' );
add_action( 'pre_get_posts', 'wpa84417_include_cat' );
share|improve this answer

You could also code it this way:

function wpsites_genesis_home_category( $query ) {
    if ( is_home() && is_main_query() && !is_admin()) {
        query_set( 'cat', '33' );
add_action( 'pre_get_posts', 'wpsites_genesis_home_category' );
share|improve this answer

Your Answer


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.