catchresponsive_alter_home

Alter the query for the main loop in homepage.

Description

catchresponsive_alter_home( $query ); 

Parameters (1)

0. $query
The query.

Usage

  1. if ( !function_exists( 'catchresponsive_alter_home' ) ) { 
  2. require_once '/inc/catchresponsive-core.php'; 
  3.  
  4. // The query. 
  5. $query = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = catchresponsive_alter_home($query); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/catchresponsive-core.php  
  1. function catchresponsive_alter_home( $query ) { 
  2.  
  3. $cats = $options[ 'front_page_category' ]; 
  4.  
  5. if ( is_array( $cats ) && !in_array( '0', $cats ) ) { 
  6. if ( $query->is_main_query() && $query->is_home() ) { 
  7. $query->query_vars['category__in'] = $options[ 'front_page_category' ];