Search Divi Blog Extras Documentation

Search for answers or browse our knowledge base.

Table of Contents
< All Topics
Print

Alter Blog Extras Query Args

apply_filters('dipl_blog_extras_query_args', array $args)

Filters the query args.


Parameters

$args
    (array) Query args

More Information

This filter is used to alter the query args of the blog loop before the posts are being retrieved from the database and before it is printed to the screen.

Usage

<?php
/**
* Getting products order by price given that product post type is already selected in the module
*/
add_filter( 'divi_blog_extras_query_args', 'dbe_get_products_by_price' );
function dbe_get_products_by_price( $args ) {
$args['orderby'] = 'meta_value_num';
$args['order'] = 'ASC';
$args['meta_key'] = '_price';
return $args;
}
Table of Contents