WordPress.org

Ready to get started?Download WordPress

Forums

Widgets on Pages
[resolved] Widget not working in post excerpt (4 posts)

  1. lisamattocks
    Member
    Posted 1 year ago #

    Hi

    I am using widgets on pages on my wordpress site and for some reason the excerpt (preview) of the post is showing the code as opposed to the actual widget. When I click read more and open the actual post I can see the widget and it works and functions properly. Do you have any idea why the code and not the actual widget is displaying in the excerpt?

    Many thanks

    Lisa

    http://wordpress.org/extend/plugins/widgets-on-pages/

  2. toddhalfpenny
    Member
    Plugin Author

    Posted 1 year ago #

    Hey Lisa,

    Just wondering if you can provide some extra info so I can see why this is happening?

    Could you let me know;

    • Which theme are you using
    • How is the summary being shown? Are you putting the shortcode in the excerpt box in the backend or is the content being automatically being truncated?
    • Can you provide a link please?

    Ta.
    Todd

  3. lisamattocks
    Member
    Posted 1 year ago #

    Hi Todd,

    Thanks for your response.

    I can provide a link: http://www.jofong.com/news

    I am using a theme called Pixia from themeforest.

    I am putting the shortcode in the post. The posts show up on a blog page (which is my news page) and the excerpt/preview of the post shows the code, when you click on read more you see the widget functioning correctly.

    Many thanks

    Lisa

  4. toddhalfpenny
    Member
    Plugin Author

    Posted 1 year ago #

    Lisa,

    This is quite strange... I had not come across this before.

    Having done some googling it looks like this is due to a feature of WordPress excerpts. WordPress, if automatically creating the excerpt from the core content of the post/page, will strip out any additional HTML tags.

    In your case this means that the HTML tags produced by my plugin and the ones produced by the twitter widget you're using are all stripped out... this has the impact that the JS isn't run and instead the code is just output as plain text.

    It looks like you can modify your theme slightly to do what you'd like... here are some links to articles on this.

    I hope this is some help.
    Thanks,
    Todd

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic