0

Is there anyway of telling wordpress, by some plugin or whatever, not to show Recent news from Category X, on my home page?

Or I may do it only by modifying the home.php code?

  • This is a theme issue. Post the code for the page. – s_ha_dum Jan 6 '13 at 17:34
  • @s_ha_dum thought so, if it's a theme issue I know what I have to do... I was just wondering if there is any alternative – w0rldart Jan 6 '13 at 17:38
1

Assuming this is the default main query, see the example for pre_get_posts, which shows how to exclude a category from the main query:

function wpa78465_exclude_category( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
        $query->set( 'cat', '-1,-1347' ); // IDs of categories to exclude
    }
}
add_action( 'pre_get_posts', 'wpa78465_exclude_category' );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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