WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to wrap a shortcode inside of a "user loggeed in" shortcode. Here are the two shortcodes and my setup in WYSIWYG

function wpfc_logged_in( $atts, $content = null ) {
    if (is_user_logged_in() )
        return do_shortcode($content);

add_shortcode('loggedin', 'wpfc_logged_in');

function info_box( $atts, $content = null  ) {
        extract( shortcode_atts( array(
        'type' => 'tip',
        'icon' => ''
    ), $atts ) );  
    $return = '<div id="info-box"><div class="info-box '.$type.'"><p>'.$content.'</p><a href="#" class="info-close-icon"></a></div></div>';
    return $return; 
add_shortcode('info_box', 'info_box');


[ info_box type='setting' ]content text[ /info_box]
share|improve this question

closed as too localized by toscho Feb 14 '13 at 19:51

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

it looks like you have extra spaces in your shortcodes.


[info_box type='setting']content text[/info_box]

instead of

[ info_box type='setting' ]content text[ /info_box]
share|improve this answer
Holy cow! Thank you lolz. I have to wait 3 mins to accept the answer. Ugh this was driving me nuts! – Androliyah Feb 14 '13 at 19:41
ok great, so your code was fine after all ;-) – birgire Feb 14 '13 at 19:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.