WordPress.org

Forums

Foundation Columns
[resolved] Processing is kicking out any shortcodes (6 posts)

  1. adambundy
    Member
    Posted 9 months ago #

    I'm having an issue where I created a shortcode that inserts a chunk of content, and I am inserting it in between 2 column shortcodes. The chunk of content appears on the page before the row element that wraps all the 'fc' column divs. Would it be possible to process shortcodes inside fc column shortcodes?

    https://wordpress.org/plugins/foundation-columns/

  2. tormorten
    Member
    Plugin Author

    Posted 9 months ago #

    I'm not able to recreate this issue. If I'm understanding you correctly, any shortcodes within a [fc]-shortcode are not processed? I've tested this issue and it seems to be working as expected here.

    Am I understanding the issue correctly?

  3. adambundy
    Member
    Posted 9 months ago #

    @tormorten, what happens is that I have a custom shortcode that inserts some code, and when I place it inside an opening and closing column shortcode, it ends up outside the column div in the markup on the front-end.

    Thanks!

  4. tormorten
    Member
    Plugin Author

    Posted 9 months ago #

    Is this a shortcode you have written yourself? Be aware that a shortcode should return its content, not echo it. If you echo the shortcode it will be printed outside of the content.

    See the Codex for more on this.

    I've tested it with native WP-shortcodes and some from other plugins (NextGen Gallery and Jiogshop) as well, and it working as expected.

  5. adambundy
    Member
    Posted 9 months ago #

    @tormorten yep you're exactly right. I did some reading up on widget coding best practices and converted my custom widget function to returning vs echoing and now all is well. Thanks for the tip!

  6. tormorten
    Member
    Plugin Author

    Posted 9 months ago #

    Glad to help ;)

Reply

You must log in to post.

About this Plugin

  • Foundation Columns
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.