[Support request] Custom Content Shortcode bug?

Home Forums Support Custom Content Shortcode bug?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #1471384

    I’ve been using the Custom Content Shortcode (CCS) plugin with GeneratePress successfully for several years. However, when I use it in Elements (hook, home page), some of my generated links are truncated. The links are fine if used in regular posts. For example, this CCS snippet:

    [loop type=news count=4]
    [field url]<br>
    <a href="[field url]">
    [field title]<br>
    [field excerpt words=15] ...

    Used via Elements, it displays:

    <a href="https://www.mydomain.com/">My Post Title
    This is an example excerpt.</a>

    The post URL [field url] is successfully displayed, EXCEPT when used inside the HREF tag. This problem does not arise when the snippet is used on an actual page, or in a post.

    There has been discussion in the Custom Content Shortcode plugin forum as to the possible cause, but I don’t know whether this is something that GeneratePress could address?

    Lead Developer
    Lead Developer

    Hi there,

    That’s strange, I’m not sure what could be causing that within Elements – we simply use the core do_shortcode() to render shortcodes in the content area.

    I think doing something like this is your best bet: https://wordpress.org/support/topic/shortcodes-not-working-inside/#post-10800074

    That way you’re not adding shortcodes into HTML markup – the entire link is rendered in a shortcode.

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