• Hi,

    I want to feature 14 pages rather than 6 posts on my front page. I have tried the following code, which has worked well on other themes, but it is not working on Twenty Fourteen:

    add_filter( 'pre_get_posts', 'my_get_posts' );
     function my_get_posts( $query ) {
     if ( is_home() && false == $query->query_vars['suppress_filters'] )
     $query->set( 'post_type', array( 'post', 'page') );
     return $query;
     }
    
    // Add support for featured content.
    function twentyfourteen_child_setup () {
      // This will remove support for featured content in the parent theme  
      remove_theme_support( 'featured-content' );
      
      //This adds support for featured content in child theme 
      //with a different max_posts value of 14 instead of default 6  
      add_theme_support( 'featured-content', array(
        'featured_content_filter' => 'twentyfourteen_get_featured_posts',
    	'max_posts' => 14,
      ) );
    }
    

    Any suggestions, please?

  • The topic ‘is it possible to feature pages instead of posta’ is closed to new replies.