WordPress.org

Support

Support » How-To and Troubleshooting » Possible to call a widget inside php tags?

Possible to call a widget inside php tags?

  • So i have a widget which allows me to write PHP on my pages. “Allow PHP in posts”. I have this because i wanted to show specific content based on which user is viewing the page. Like this:

    [php]
    
    	global $user_ID;
    	if($user_ID == 4){
    		echo "You have 365 days left of your subscription!";
            }
    [/php]

    I recently installed a progress bar widget/plugin to display a progress bar. It works perfectly when it is outside of the php tags, but i want to place it inside the php tags, so its only visible for the user with ID 4. When i place it inside, it completely removes everything i have in side the PHP tags; You have 365 days left of your subscription!.

    Does anyone know how to get it to work? Cheers

  • The topic ‘Possible to call a widget inside php tags?’ is closed to new replies.
Skip to toolbar