Support » Plugin: Display Posts Shortcode » Not working in text widget?

  • Resolved Joelle


    Hi there, awesome plug-in, thanks!

    I’m using WP 3.5 and Display Posts Shortcode 2.3.

    Small issue — I do have the shortcode bits in my function.php file, but in spite of that, the shortcode doesn’t display in my text widget.

    I’m using the example from the docs: [display-posts id="648"] (the ID being the page that I need displayed) Is it because its a page and not a post, specifically? I’ve tried several other pages and can’t get it to display anything. The shortcode doesn’t display, just nothing shows.

    I’d really appreciate any insight. Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Daniel Bachhuber


    Hand Built

    Hey Joelle,

    WordPress doesn’t currently offer support for shortcodes in text widgets. You can learn more about the history of that idea here.

    Plugin Author Bill Erickson


    You can add support for shortcodes in your widgets by adding this to your functions.php file:

    add_filter( ‘widget_text’, ‘do_shortcode’ );

    Hi there,

    Thanks for your feedback, but I think we’re missing my actual question — perhaps I phrased it poorly. 🙂

    I’ve already inserted the do_shortcode filter in my functions.php file, which I mentioned initially. It IS rendering the shortcode, in general.

    However, my question is *why won’t it show the contents of a PAGE?* It shows shortcode for posts by category and many other thing, but I can’t get it to display the contents of a page, despite having the correct ID in there. Since pages are technically posts, I’m confused.

    I’ve included the filter in my functions file, I’ve inserted the shortcode straight from the plugin docs, but it won’t show me that post ID — so I’m asking — does the display_posts plugins only apply to blog posts and not page content?

    Thanks so much for your insight. 🙂

    Daniel Bachhuber


    Hand Built

    Have you tried passing post_type=’page’ too?

    YAY! Thank you, Daniel. That totally worked. I’m not sure how I overlooked that little nugget of information.

    I am trying to get it to display the actual content of the page, not just the title, but there’s probably a call for that, too… I’ll have to go look.

    Thanks again!

    Could you post the full fix for this please I have the do_shortcode filter in my functions.php file but don’t quite understand where / how the passing post_type=’page’ too should be implemented. Thanks

    Hi nudeweb,

    [display-posts id="648" post_type="page" include_excerpt="true" wrapper="div"]

    This is how I used it. I hope that helps!

    Hello, I’m trying to display posts in a 1/3 column on the homepage using the JetPack widget. The category i’m wanting to display is the “Home” category and i’m using the following code in the column:

    [display-posts id=”home” include_excerpt=”true” image_size=”thumbnail” wrapper=”div”]

    I’ve followed the instructions here: but still cannot get anything to work 🙁

    The test server is and the column is the middle column.

    Any help would be great and much appreciated!

    Sorry, the test server is

    The shortcode i’ve tried to use is:

    [display-posts id=”home” include_excerpt=”true” image_size=”thumbnail” wrapper=”div”]

    and i’ve also tried:

    [display-posts category=”home” include_excerpt=”true” image_size=”thumbnail” wrapper=”div”]

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not working in text widget?’ is closed to new replies.