WordPress.org

Forums

Possible to call a widget inside php tags? (1 post)

  1. StayCool
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic