adding regular php variables in a post (2 posts)

  1. jordb
    Posted 7 years ago #

    im trying to add a simple php variable in a wordpress page i have created, however it doesn't seem to work.

    I have installed the plugin "runPHP" because i was told thats what i need to use. however i can't seem to get this to work.

    in my page i added:

    $bgimage = "test";

    and on pages.php i want to echo this after the post so i have:

    echo $bgimage;

    Any help would be great, thanks

  2. Add global $bgimage; in front of both of your uses of it.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.