Advertisement
phpface

Untitled

Oct 6th, 2017
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. if( ! function_exists( 'cobalt_filter_the_cobalt_post_data_args' ) ){
  2.     /**
  3.      *
  4.      * Filter the post args.
  5.      *
  6.      * @param array $args
  7.      * @return array
  8.      */
  9.     function cobalt_filter_the_cobalt_post_data_args( $args ) {
  10.         if( basename( get_page_template() ) == 'template-blog-masonry.php' ){
  11.             /**
  12.              * @link https://codex.wordpress.org/Class_Reference/WP_Query
  13.              *
  14.              */
  15.             $args['post_type'] = 'page';
  16.         }
  17.        
  18.         return $args;
  19.     }
  20.     add_filter( 'cobalt_post_data_args' , 'cobalt_filter_the_cobalt_post_data_args', 10, 1 );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement