• Resolved pitterpat1

    (@pitterpat1)


    Hi,

    Am I doing something wrong???

    I have a home page which contains some text with some html tags.

    I added the following at the bottom of the page:
    <?php echo “hello world”; ?>

    And hello world does NOT appear on the page!

    What am I doing wrong? Are you not able to use php on a page? That doesn’t make sense.

    BTW, I’m a newbie so please be gentle.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • no, you can’t use php code in posts or pages unless you use a plugin for it.

    try phpexec for example. (copy the text, rename to phpexec.php and upload into your plugins directory)

    then simply put your code between <phpcode> … </phpcode>

    Either that, or put your php bits into a template.

    Thread Starter pitterpat1

    (@pitterpat1)

    OK, if I can’t use php in a post, (actually it’s not a user’s post but rather the text on a page I created) then how would I include an image on a page w/o knowing the proper url?

    I want use bloginfo as in <img src=”<?php bloginfo(‘template_url’); ?>/images/my-pic.jpg” alt=””/>

    Can I accomplish the same thing w/o using php?

    Thanks

    u cant write php code from ur write page but if u want to, u can do with Runphp plugin.

    <?php bloginfo('template_url'); ?> = http://urdomain/wp-content/themes/ur themes folder/

    Thread Starter pitterpat1

    (@pitterpat1)

    Thanks to all!

    I used runPHP for no particular reason as I didn’t have any feel for which approach would be easier, more powerful, etc.

    It works like a charm!

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Using php on pages – not working’ is closed to new replies.