/**
 * [rbm_pagesize description]
 * @param  [type] $query [description]
 * @return [type]        [description]
 */
function rbm_pagesize($query)
{
    if (is_admin() || !$query->is_main_query()) {
        return;
    }
    if (is_post_type_archive('members') || is_tax('member-types')) {
        $query->set('posts_per_page', -1);
        return;
    }
}
Ejemplo n.º 2
0
/**
 * [category_pagination description]
 * @param  [type] $query [description]
 * @return [type]        [description]
 */
function category_pagination($query)
{
    if ($query->is_category() && $query->is_main_query()) {
        $query->set('posts_per_page', 6);
    }
}
 /**
  * exclude all categories that are locked for the visitor
  *
  * @author Lukas Juhas
  * @date   2016-02-05
  * @param  [type]     $query [description]
  * @return [type]            [description]
  */
 public function update_shop_queries($query)
 {
     // don't run if it's admin
     if (is_admin()) {
         return;
     }
     // make sure it's main query
     if (!$query->is_main_query()) {
         return;
     }
     // make sure its archive page
     if (!$query->is_post_type_archive()) {
         return;
     }
     // get locked categories / taxonomies
     $locked = wcl_get_locked_categories();
     // set query to exclude locked ones
     $query->set('tax_query', array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $locked, 'operator' => 'NOT IN')));
     return $query;
 }
Ejemplo n.º 4
0
 /**
  * A kezdőlapon megjelenítendő extra típusok
  *
  * @author NewPlayer
  * @since 2015-10-14
  *
  * @param  [type] $query [description]
  * @return [type]        [description]
  */
 function extraTypesInHomePage($query)
 {
     if (is_home() && $query->is_main_query() || is_feed()) {
         $query->set('post_type', array('post', 'download'));
         return $query;
     }
 }