Is there a way to force the Recent Global Posts Widget to use the Excerpt field?

Is there a way to force the Recent Global Posts Widget to use the Excerpt field or to not publish code from the post like caption tags, etc?

There should be a setting to pull from the excerpt field (if it exists), or to force it to only pull from the post or excerpt fields.

Otherwise, how do get it to stop publishing caption tags or other codes that aren't otherwise shown on the actual post, and which look horrible on a recent posts widget feed?

Thanks.

  • Michael Bissett

    Hey @markweb, hope you're doing well this evening! :slight_smile:

    There's one thing that we can try here, though it will require that we modify the core of the plugin. You'll want to note the changes made, as they'll be lost on an update to the plugin.

    (before we continue, please make a backup of the file we'll be editing here, just to be safe)

    Inside recent-global-posts-widget/widget-recent-global-posts.php, on line 175, you should see the following code:

    $the_content = network_get_the_content();

    Make a new line below that one, and enter in this bit of code:

    $the_content = strip_shortcodes($the_content);

    Save the file, and try viewing the feed, the shortcodes should now be removed.

    Let me know if I can be of further assistance here please! :slight_smile:

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.