Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #921629

    Hello! Thank you for your awesome theme, your excellent theme support, all the hard work you do.

    I am using Yoast SEO for my site, and I’m trying to set up the meta description template so that %%excerpt%% returns the first 160 characters of my post as its meta description. The problem is that I see excerpts in Enfold don’t register if the content is created in Advanced Layout Editor. While I understand that I can create a custom excerpt instead, it would be much more efficient for me if there was a php function I could add to the site that was able to pull a forced content section, even from a target div, that could return an excerpt value.

    Is there anything you can suggest which can make the excerpts (for pages) propagate dynamically so I don’t have to do it for each individual page?

    • This topic was modified 6 years, 8 months ago by Onlysky.
    #921752

    Update:

    I was able to force a manual excerpt by installing this plugin: https://wordpress.org/support/plugin/wp-excerpt-generator/. I fiddled with some of its settings and replaced the shortcode stripper code in its function file with:

    $content = preg_replace('/\[[\/]?av_[^\]]*\]/', '', $content);

    So now each page has an automatically generated manual excerpt which pulls the text from the page, even if built with the advanced layout editor. The only problem I’m encountering now is trying to figure out a way to limit the characters in the manual excerpt box, or in the %%excerpt%% variable used by Yoast. Does anyone have any insight?

    • This reply was modified 6 years, 8 months ago by Onlysky. Reason: Formatting
    #921839

    Hi,

    I am afraid you’ll need to contact the plugin author for more info about the issue. Making third-party plugins compatible with the theme is unfortunately beyond the support scope we offer. Sorry for that!

    Best regards,
    Basilis

    #1001096

    Hi Onlysky,
    Could you further explain how you were able to make excerpts automatically show up, when using AVL?
    Were you able to limit the characters already as well?
    Thanks,
    Robbert

    #1001363

    Hi,

    Robert you need to limit the excerpts on blog page?

    Best regards,
    Basilis

    #1001376

    Hi Robert,
    By using the plugin I linked to above, I was able to force automatic excerpts by modifying a bit of the plugin’s code. I replaced line 137 of wp-excerpt-generator-options.php in the plugin files with the code I pasted above, and it works as long as the plugin settings within WordPress are set to strip shortcodes, remove line breaks and html. I was never able to limit the excerpts successfully by character, but I found that limiting them by words does seem to work–though it is not exact.

    #1001511

    Hi Onlysky,

    Thanks for sharing, much appreciated :-)

    Best regards,
    Rikard

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.