[Support request] Custom Content Shortcode bug?

Home Forums Support Custom Content Shortcode bug?

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

    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] ...
    </a>
    [/loop]	

    Used via Elements, it displays:

    https://www.mydomain.com/news/my-post-title-001
    <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?

    #1471977
    Tom
    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.