Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using /'s in PHP code

    Hi all,

    Wondering if anyone can help me...

    I'm trying to hardwire some shortcode functionality which is built in to the theme of my wordpress site...

    The shortcode allows for content to be toggled open and closed.

    Here's the code I have used:

    <?php echo do_shortcode('[toggle title_open="Hide Reviews" title_closed="Show Reviews" hide="yes" border="yes" style="white"]'); ?>

    Text that i want to toggle, blah blah

    <?php echo do_shortcode('[/toggle]'); ?>

    On the pages however it doesn't seem to recognize the [/toggle] part, as it just adds " [/toggle] " on to the end of the text i want to toggle, blah blah :-/


    I have a sneaky suspicion that it's something to do with the ending [/toggle] part??

    Could anyone advise at to how I could fix this???

    Cheers,
    Ben

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ohio
    Posts
    254
    Thanks
    1
    Thanked 63 Times in 63 Posts
    Assuming the shortcode code was "created" properly, you would not require a closing tag which seems to be the case in your situation.

    Ref:
    http://core.trac.wordpress.org/brows...shortcodes.php


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •