Featured Content * @link http://jetpack.me/support/featured-content/ * @link http://www.hongkiat.com/blog/wordpress-featured-content/ * * CONTENT: * - 10) Actions and filters * - 20) Custom Header functions */ /** * 10) Actions and filters */ /** * Actions */ //Display the featured area add_action( 'wmhook_header_after', 'wm_banner_area', 10 ); /** * 20) Custom Header functions */ /** * Getter function * * IMPORTANT: * Filter hook name has to match the function name, * so do not use the 'wmhook_' prefix. */ if ( ! function_exists( 'wm_get_banner_posts' ) ) { function wm_get_banner_posts() { return apply_filters( 'wm_get_banner_posts', array() ); } } // /wm_get_banner_posts /** * Conditional function * * IMPORTANT: * Filter hook name has to match the function name, * so do not use the 'wmhook_' prefix. */ if ( ! function_exists( 'wm_has_banner_posts' ) ) { function wm_has_banner_posts( $minimum = 1 ) { if ( is_paged() ) { return false; } $minimum = absint( $minimum ); $featured_posts = apply_filters( 'wm_get_banner_posts', array() ); if ( ! is_array( $featured_posts ) || $minimum > count( $featured_posts ) ) { return false; } return true; } } // /wm_has_banner_posts /** * Featured area */ if ( ! function_exists( 'wm_banner_area' ) ) { function wm_banner_area() { if ( is_front_page() && ! is_paged() ) { get_template_part( 'loop', 'banner' ); } } } // /wm_banner_area ?>