// Load our function when hook is set add_action( 'pre_get_posts', 'rc_modify_query_exclude_category' ); // Create a function to excplude some categories from the main query function rc_modify_query_exclude_category( $query ) { // Check if on frontend and main query is modified if ( ! is_admin() && $query->is_main_query() && ! $query->get( 'cat' ) ) { $query->set( 'cat', '7' ); } // end if } add_action( 'genesis_meta', 'foodie_home_genesis_meta' ); /** * Add widget support for home page. * If no widgets active, display the default loop. * * @since 1.0.1 */ function foodie_home_genesis_meta() { if ( is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-middle' ) || is_active_sidebar( 'home-bottom' ) ) { // Remove the default Genesis loop. remove_action( 'genesis_loop', 'genesis_do_loop' ); // Add a custom loop for the home page. add_action( 'genesis_loop', 'foodie_home_loop_helper' ); } } /** * Display the home page widgeted sections. * * @since 1.0.0 */ function foodie_home_loop_helper() { // Add the home top section if it has content. if ( is_active_sidebar( 'home-top' ) ) { genesis_widget_area( 'home-top', array( 'before' => '
', 'after' => '
', ) ); } // Add the home middle section if it has content. if ( is_active_sidebar( 'home-middle' ) ) { genesis_widget_area( 'home-middle', array( 'before' => '
', 'after' => '
', ) ); } // Add the home bottom section if it has content. if ( is_active_sidebar( 'home-bottom' ) ) { genesis_widget_area( 'home-bottom', array( 'before' => '
', 'after' => '
', ) ); } } genesis();