• jerseygirl

    (@jerseygirl)


    Hi, I have a php file that I need to include in a WordPress page.

    Essentially, the php file calls up information from a database and displays it in a table form.

    the include on a normal html page looks like this:

    <!–#include virtual=”../services/lulu.php” –>

    But, I can’t get that to work on a Word Press page. Please help me know what to do to make this work!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Richard

    (@richardcoffee)

    <?php include("../services/lulu.php"); ?>

    Depending on where you are inserting this in a file, you may not need the surrounding php tags. Also, this will not work from within the editor. WordPress does not execute php there, due to security concerns.

    Thread Starter jerseygirl

    (@jerseygirl)

    ok, so where or how would I insert this in the file?

    I know very little about Php, but enough to know that I don’t want to mess anything up! ??

    Basically what the include is this:

    I am creating directory pages which pull listings from a database. There will be about 30 pages, each calling a different php file which creates a table with the database results for that category of service.

    If I can’t include php in the editor, then where would I place this code on each individual page?

    Please help. I am migrating a static site to a word press site and I am stuck.

    Richard

    (@richardcoffee)

    Sorry for the late reply. I don’t log on here on a regular basis. I hope you have already solved the problem…

    If I am understanding your problem correctly, I would not create the 30 different pages, but rather 1 single template file that can display any category. The category can be passed back to the server as a POST variable, which the template can then read and include the appropriate php file to display the category requested.

    Frankly, this is not specifically a WordPress question, and you might be better served looking for information on websites dealing more generally with php .

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to include a Php file’ is closed to new replies.