Advertisement
srikat

Untitled

Dec 14th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. //* Show Movies CPT entries in addition to Posts in Posts page (props Bill Erickson)
  2. add_action( 'pre_get_posts', 'cpt_entries_and_posts' );
  3. function cpt_entries_and_posts( $query ) {
  4.  
  5.     if ( $query->is_main_query() && !is_admin() && is_home() ) {
  6.         $query->set( 'post_type', array( 'post', 'movie' ) );
  7.     }
  8.  
  9. }
  10.  
  11. add_filter( 'genesis_attr_content', 'custom_attributes_content' );
  12. /**
  13.  * Add the class needed for FacetWP to main element.
  14.  *
  15.  * Context: Posts page
  16.  *
  17.  * @author Sridhar Katakam
  18.  * @link   http://sridharkatakam.com/facetwp-genesis/
  19.  */
  20. function custom_attributes_content( $attributes ) {
  21.  
  22.     if ( is_home() ) {
  23.         $attributes['class'] .= ' facetwp-template';
  24.     }
  25.     return $attributes;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement