WordPress.org

Ready to get started?Download WordPress

Forums

EasyRotator for WordPress - Slider Plugin
[resolved] Excerpt not populating from Content? (4 posts)

  1. slicesofamerica
    Member
    Posted 6 months ago #

    Love the slider - nice tool! But why is it that posts with a manually entered excerpt display a "description", but if the excerpt field is blank, no description shows? Doesn't the excerpt automatically populate the space with text from the content? Is there a workaround? I have hundreds of posts with no excerpt and would hate to have to go back and manually enter excerpts for all of them. Thanks!

    https://wordpress.org/plugins/easyrotator-for-wordpress/

  2. DWUser.com
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    Thanks for using EasyRotator for WordPress! Here's a post with instructions describing how to use the post content instead: https://wordpress.org/support/topic/description-field-using-content-instead-of-excerpt

    You may want to use the wp_trim_words function to automatically generate an excerpt when the description exceeds a certain length. For example, the updated line might be:

    $description = wp_trim_words($post->post_content, 50);

    Please let me know if you have any other questions.

    Sincerely,
    Drew O'Neill

  3. slicesofamerica
    Member
    Posted 6 months ago #

    Thanks for the quick reply. Two final questions:

    1. Does this mean that with every update of the plugin, I will lose my coding?

    2. When I call the content, won't that also insert images if images are part of the content?

    Best,
    Taylor

  4. DWUser.com
    Member
    Plugin Author

    Posted 6 months ago #

    Hi Taylor,

    1 - If you make this modification, you will need to update that one line of code after any subsequent updates.

    2 - You could also strip HTML by using:

    $description = strip_tags(wp_trim_words($post->post_content, 50));

    Sincerely,
    Drew O'Neill

Reply

You must log in to post.

About this Plugin

About this Topic