WordPress.org

Ready to get started?Download WordPress

Forums

Easy Featured Content
Shortcode (1 post)

  1. Bev
    Member
    Posted 1 year ago #

    Nice plugin!

    I wanted to use this with a shortcode, so I tied into the Display Posts Shortcode plugin by adding a filter to the shortcode args. I thought I'd share the code here. Use it by adding featured='yes' to your shortcode.

    function fc_display_posts_shortcode_featured( $args, $atts ) {
    
    	if( isset($atts['featured']) && ($atts['featured'] == 'yes') ) {
    		$args['meta_key'] = Featured_Content::IS_FEATURED_CONTENT_KEY;
    		$args['meta_value'] = 'yes';
    	}
    
    	return $args;
    }
    add_filter( 'display_posts_shortcode_args', 'fc_display_posts_shortcode_featured', 10, 2 );

    http://wordpress.org/extend/plugins/easy-featured-content/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.