Jetpack Featured Content

Download Jetpack Featured Content

Post on 14-Aug-2015

174 views

Category:

Technology

0 download

Embed Size (px)

TRANSCRIPT

<ol><li> 1. Showcase your content using Jetpack's Featured Content by Mikey Arce 1 </li><li> 2. Featured Content provides a way for a user or client to visually change the display of posts easily, using tags. Doesn't duplicate content No need to install another plugin Makes it really easy for users by Mikey Arce 2 </li><li> 3. Featured Content Jetpack's Featured Content adds a Customizer Section to allow you to congure the settings. by Mikey Arce 3 </li><li> 4. Setting it up 1. Add a tag of your choice to the Customizer (e.g. "Featured", "New", "News", etc) 2. Tag your posts with that tag! 3. Prot. by Mikey Arce 4 </li><li> 5. Examples by Mikey Arce 5 </li><li> 6. by Mikey Arce 6 </li><li> 7. by Mikey Arce 7 </li><li> 8. by Mikey Arce 8 </li><li> 9. by Mikey Arce 9 </li><li> 10. How do you use it? by Mikey Arce 10 </li><li> 11. Add Theme Support add_theme_support( 'featured-content', array( 'filter' =&gt; 'mytheme_get_featured_posts', 'max_posts' =&gt; 20, 'post_types' =&gt; array( 'post', 'page' ), ) ); by Mikey Arce 11 </li><li> 12. Return the posts into a function function mytheme_get_featured_posts() { return apply_filters( 'mytheme_get_featured_posts', array() ); } by Mikey Arce 12 </li><li> 13. Make sure they exist function mytheme_has_featured_posts( $minimum = 1 ) { if ( is_paged() ) return false; $minimum = absint( $minimum ); $featured_posts = apply_filters( 'mytheme_get_featured_posts', array() ); if ( ! is_array( $featured_posts ) ) return false; if ( $minimum &gt; count( $featured_posts ) ) return false; return true; } by Mikey Arce 13 </li><li> 14. Let's add them into our theme We're going to use get_template_part to be smart. if ( is_front_page() &amp;&amp; mytheme_get_featured_posts() ) { // Include the featured content template. get_template_part( 'content', 'featured' ); } by Mikey Arce 14 </li><li> 15. get_template_part by Mikey Arce 15 </li><li> 16. Now let's display them content-featured.php by Mikey Arce 16 </li><li> 17. by Mikey Arce 17 </li><li> 18. Outputting content into a slider using Flexslider by Mikey Arce 18 </li><li> 19. Q &amp; EH? by Mikey Arce 19 </li><li> 20. mikeyarce.com/ featured-content by Mikey Arce 20 </li></ol>