• Resolved Shaunrafuse

    (@shaunrafuse)


    I wanted to limit the featured posts in the twenty fourteen theme to 3 instead of 6 I’ve tried changing the value in the code but that did not work. Any suggestions???

Viewing 6 replies - 1 through 6 (of 6 total)
  • In your child theme’s function.php add these lines

    // Use the after_setup_theme hook with a priority of 11 to load after the
    // parent theme, which will fire on the default priority of 10
    add_action( 'after_setup_theme', 'childtheme_featured_content', 11 ); 
    
    function childtheme_featured_content() {
    	//This will remove support for featured content
    	remove_theme_support( 'featured-content' );
    
    	//This will re-enable support for featured content with max of 3 posts
    	add_theme_support( 'featured-content', array(
    		'featured_content_filter' => 'twentyfourteen_get_featured_posts',
    		'max_posts' => 3,
    	) );
    }
    Thread Starter Shaunrafuse

    (@shaunrafuse)

    Thanks Rajesh..

    Is there a way to do this using the Custom CSS Manager, or it has to be done in a child theme???

    Thread Starter Shaunrafuse

    (@shaunrafuse)

    I’ve been trying to set up a child theme but I don’t even know how to access cPanel on GoDaddy to upload the files, nor do I know how/where to upload them via an https://FTP..

    This is driving me nuts I’ve done everything I can without using a child theme, now it seems I have no choice but to create one and I’m lost.

    All tutorials say create folder for the theme in cPanel or upload via FTP but I can’t figure it out.

    Thread Starter Shaunrafuse

    (@shaunrafuse)

    Rajesh, I created a duplicate theme using a theme duplicator plugin, loaded the child theme, entered your provided code in the functions.php, but it did not work.. Any suggestions???

    After adding the above function to your child theme’s functions.php
    Go to appearance > customize
    Check if any change made by you in featured content is reflecting.

    Thread Starter Shaunrafuse

    (@shaunrafuse)

    Ok I got it! Thank you Rajesh, appreciate it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Limiting featured posts twenty fourteen’ is closed to new replies.