WordPress.org

Support

Support » How-To and Troubleshooting » Call up PHP file

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

    @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.

    Roy

    @gangleri

    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.

    http://read.mangashare.com/Naruto/chapter-425/page001.html

    anyone know?

    Roy

    @gangleri

    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
    http://codex.wordpress.org/Pages#Page_Templates

    This explains how to “include” your own custom php template file,
    http://codex.wordpress.org/Stepping_Into_Templates#Template_Files_Within_Template_Files

    Also take a look at this plugin,
    http://www.vtardia.com/improved-include-page/

    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.
Skip to toolbar