WordPress.org

Support

Support » Plugins and Hacks » PHP snippet works in page code but not in widget

PHP snippet works in page code but not in widget

  • AnotherOpus
    Member

    @anotheropus

    This code (below) works in the WordPress header.php

    But in the Executable PHP widget nothing appears-with or without a title in the widget.

    <?php if (is_user_logged_in()){
    global $current_user; get_currentuserinfo();
    echo('Welcome, ' . $current_user->user_firstname . '  ');
    }
    else {
    echo "Welcome, Visitor |  ";
    }; ?>

    Is there some setting I need to check to enable the PHP Code widget?

    http://wordpress.org/extend/plugins/php-code-widget/

  • The topic ‘PHP snippet works in page code but not in widget’ is closed to new replies.