Support » Fixing WordPress » Getting content inside shortcode

  • I have a shortcode defined which works well on the content.

    [shortcode]
        Contents inside shortcode
    [/shortcode]

    Now what i want is to get the contents inside the short code to give a preview of the post on loop-post.php. In other words I need the raw contents on the shortcode before it get parsed.

    Let me know if you have any questions. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Im looking to do something similar. I want to echo the contents inside a conditional statement… I havent totally figured it out but been playing with something like this

    echo do_shortcode('[shortcode]'. the_content() .'[/shortcode]');

    Would love to hear someone elses opinion on this.

    @digitalrenewal: actually when you use $content = get_the_content(); you actually get the content without the shortcode parsed. Then you can use regex to find out the content inside the shortcode.

    Let me now if you have more questions.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting content inside shortcode’ is closed to new replies.