SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Nov 2008
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wordpress function use in other files

    Hi is there any way to use the wordpress functions outside of the system itself?

    My scenario:

    I have made a form processing file signup.php, which I put with the rest of template files. Now when a user fills in the form on my homepage or other pages (all using index.php), the form on will call signup.php to send an email with the details and present a thank you note. I wanted to style the signup.php page like the rest of the site and thus tried to use get_header and get_footer, for example. However I'm getting a fatal error. How I should I go about fixing this? thanks

  2. #2
    SitePoint Member
    Join Date
    Sep 2006
    Location
    Belgium
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I'm remember well, you have to put these line at the top of your php file:

    Code:
    if ( !isset($wp_did_header) ) {
    		$wp_did_header = true;
    		require_once( 'wp-load.php');
    		wp();
    		require_once( ABSPATH . WPINC . '/template-loader.php' );
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •