Flexible Posts Widget
[resolved] Shortcode (10 posts)

  1. PeterRinderer
    Posted 4 years ago #

    I like your new plugin very much. It is possible to add the shortcode-feature. I want tu use it not only as a widget, but within a post! Thanks a lot, Peter


  2. DaveE
    Plugin Author

    Posted 4 years ago #

    Hi Peter,

    Sorry for my slow response. Yes, that seems plausible. I'll add it to the wish list. Thanks for using the plugin!

  3. Ricardo
    Posted 4 years ago #

    I'd love to see this feature too.
    Is there a function to call in order to include the content of the widget in a template? Thanks!

  4. Ricardo
    Posted 4 years ago #

    I realized the plugin shows private posts, even if you're not logged in your blog. They should be hidden.

  5. DaveE
    Plugin Author

    Posted 4 years ago #

    Good catch, Richard. I've updated the plugin to not include Private posts.

  6. Ricardo
    Posted 4 years ago #

    Great! Thank you!

  7. DaveE
    Plugin Author

    Posted 4 years ago #

    Peter & Richard,

    I spent some time thinking through adding shortcode support over the weekend (as well as publishing a new version of the plugin) and am not sure if it really makes sense to add that to the existing plugin as the plugin is very widget-specific. It almost seems like a completely separate plugin (functionality-wise).

    But, I haven't forgotten about the request. I'll let you know how things proceed.

  8. Ricardo
    Posted 4 years ago #

    Hi Dave!
    It's your choice and it will be welcome as you decide to do it. :)
    Thank you!

  9. capson
    Posted 3 years ago #

    Hello, here is a work-a-round for shortcodes. To do this you will need a custom_functions.php file:

    1.) Create a widgitized sidebar that is called with a shortcode

    Place in your custom_functions.php file:

    //Registering the sidebar1
    function ilc_register_sidebars1(){
            'name' => 'Sidecode1',
            'description' => 'Widgets in this area will be shown using [shortbar1]',
            'before_widget' => '<div id="%1$s" class="%2$s">',
            'after_widget' => '</div>',
    	'before_title' => '<h3>',
    	'after_title' => '</h3>'
    add_action( 'init', 'ilc_register_sidebars1');
    add_shortcode( 'shortbar1', 'shortbar_sc1' );
    //Creating the shortcode output
    function shortbar_sc1( $atts ) {
        $html = ob_get_contents();
        return $html;

    Then, add to a page or post with [shortbar1] now
    go to widget page and add post widget to the sidecode1 sidebar.

    You will probably need a plugin like widget logic or Widget Logic Visual or display widgets so you can use the [shortbar1] more then once.

    If you need more then one sidebar change all the 1's to 2's
    except do NOT change these <div id="%1$s" class="%2$s">

    I hope this is helpful.

  10. capson
    Posted 3 years ago #

    Also, I just found this plugin that does the same thing, I have not used it but here is the link:

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Flexible Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic