Support » WP-Advanced » Using PHP in WordPress

Using PHP in WordPress

  • I would like to build a few .php pages in order to process a form and then present API errors and thank-yous. Is that possible on the WP CMS? What would I need to do in order to make that happen?

    As an alternative solution, I would like to process a form wholly within a WordPress page. Is it possible to have wordpress php functions and other php notation on the same page? For example, may I start a session before the header is called?

Viewing 15 replies - 1 through 15 (of 21 total)
  • I just wanted to note the error that I got:

    Fatal error: Call to undefined function get_header() in /home/afalik/globalcitizenyear.org/wp-content/themes/deMar/DoDirectPaymentReceipt.php on line 83

    The get_header() function is the first problem but I can’t think why that would be undefined?

    It seems that you are calling the .php page directly. To use WordPress functions you have to include “wp_load.php” file exists in the WordPress root directory.

    The better option is use custom page template (http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)


    Hi there, every one.
    I use a plug-in called PHP Exec.

    In every page I want to include php code, I write this:

    And it works… 😉

    Best regards.


    Sorry about that.

    The link to the plugin’s web:

    Best regads.

    php exec can lead to security issues tho.

    Hi keenanwl,

    The best way to do this is to create page templates based on your wordpress theme. Customize the page template however you want with your custom PHP code.

    Now create a page in wordpress using that page template. That should do the trick.

    If you need more info, do ask.

    Here are a few links:
    >> http://www.davidrisley.com/how-to-custom-page-template-wordpress/
    >> http://codex.wordpress.org/Pages#Page_Templates


    Page templates is the way to go … and very easy to implement … plus they’re re-usable. I agree completely with sterex.

    Hi Guys,

    My youtube video link is not shwing up on my Home page.

    Pls Pls help me.

    I dont know what I am doing wrong.

    Pls log in to : http://www.agedcareaid.com.au can u will see ” page cannot be displayed” error – some issues with how i hv pasted the code.

    Can someone pls put me in the rite direction?

    Thanks an Thanks tons


    Your video URL is malformed. Instead of this:


    Use this link:

    Thank you Luke

    It’s still not working 🙁

    i dont knw where I am going wrong….

    Thanks tons

    Try using this for the link beneath the video:

    And, use this code for the iframe (paste it as HTML):

    <iframe title=”YouTube video player” width=”640″ height=”390″ src=”http://www.youtube.com/embed/Nvb4fxRzQw4″ frameborder=”0″ allowfullscreen></iframe>

    You currently have extraneous data in your URLs.

    As other said, page templates is the way to go

    You can use this….

    define(‘WP_USE_THEMES’, false);

    for header

    <?php include (TEMPLATEPATH . ‘/header.php’); ?>

    for sidebar

    <?php include (TEMPLATEPATH . ‘/sidebar.php’); ?>

    for footer

    <?php include (TEMPLATEPATH . ‘/footer.php’); ?>

    Hi there all,

    i am looking for some function using which the default user registeration pattern can be changed, i.e. when new user try to create a user by default wordpress ask a username and email. and sends the password to the user given email.

    i need to have function to enter their password manually rather then randomly generated password

    My question how to sort this out? Does WordPress have any quick edit for this rather than changing wp-login.php to get this functionality.

    Shall be very thankful.
    I had posted this question in “How to and troubleshoot” but no buddy answered it.

    Farhan Islam

    Guys i am fresher for WordPress
    i am trying to redirect page to otherpage
    but in i am not getting any page name in URL only some codes

    i checked this
    Permalink Settings here also they gave some codes only.

    how to get page name to use in “a herf ” tag

    or any other option to redirect.

    plz help me guys.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Using PHP in WordPress’ is closed to new replies.