Support » Fixing WordPress » Call up PHP file

  • Does anyone know how to call up a php file in wordpress? I have a php file and i want to insert it in a page of mine. Is there a way to do that?
    I looked up everywhere but i just found a php exec script but I just want to call it up and use its funtions.

Viewing 8 replies - 1 through 8 (of 8 total)
  • mrmist


    Forum Janitor

    You can either add your PHP / include to a template, or you can use a plugin that lets you execute PHP from within “normal” posts.

    i don’t want to execute it.
    I want to somehow call it. I tried the php-exec script == didn’t work.
    Then I tried the runPHP == also didn’t work.

    I tried to insert the php code into index.php and it worked, but then the function has been available at every page.

    It seems that you’re well passed halfway. How about putting it in the index.php, save it under another name and on the place where you DO want the code executed, use that template? Do you want to call it with a certain page or post? When writing that one you can choose that other template.

    I have a script like that and I want it to be executed in my wordpress from a specific Page.

    anyone know?

    Hm, this was easier in older versions. In the sidebar of the admin in the “write” screen, you could simply choose a template. Maybe in newer versions this option is only there when you have different templates. In any case, try the options from my previous reply:
    – make a new template with the code in it. you can just open the index.php, put the code in and save it as “index2.php” or whatever name you have in mind;
    – “manage” that page that you want to use the template from and see if you can choose that other template (index2 or whatever you called it).

    If that doesn’t work, I’m out of suggestions.

    This explains how to create custom page templates, and how to switch your page to your custom template, example my-very-special-unique-page.php

    This explains how to “include” your own custom php template file,

    Also take a look at this plugin,

    I hope this helps ya.

    thank you very much.i will start doing it right now

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Call up PHP file’ is closed to new replies.