How to Include PHP file to WordPress

A lot of efforts can be saved by including a single file template in the wordpress. This means that one can create a standard header, footer, or menu file for all the web pages e.g. the header can be updated by including one php header file.


get started How to Include PHP file to WordPress

Below mentioned are the steps to be followed for the installation of the WordPress plugin:

  1. Go to Plugins > Add New.
  2. Type in the name of the WordPress Plugin or descriptive keyword or tag in the search form or click a tag link below the search form.
  3. Find the WordPress Plugin you wish to install.
    • Click Details for more information on the WordPress Plugin.
    • Click Install Now to install the WordPress Plugin.
  4. A popup window will ask you to confirm your wish to install the Plugin.
  5. If this is the first time you’ve installed a WordPress Plugin, you may need to enter the FTP login credential information. If you’ve installed a Plugin before, it will still have the login information. This information is available through your web server host.
  6. Click Proceed to continue with the installation. The resulting installation screen will list the installation as successful.
  7. Click Activate Plugin to activate it, or Return to Plugin Installer for further actions.

plugin How to Include PHP file to WordPress

8. Once the installation is done, click on WP Include button & choose the path where the files to be included are located.

wp include How to Include PHP file to WordPress

Save PHP File on your Machine

  1. The first thing that you need to do is to create a file called sample_header.php. This file will contain all the site design information that goes below the content.
    Here is an example:
    Menu Button 1 | Menu Button 2 | Menu Button 3 | Menu Button 4 | Menu Button 5
  2. Next we need to make a file called sample_footer.php. This file will contain all the site design information that goes below the content.
    Here is an example:
    Copyright © 2013 My Site. All rights reserved. | Terms & Conditions | Privacy Policy
  3. Finally you need to Add New Page the content pages for your site. In this file you will:

add new page How to Include PHP file to WordPress

Call the sample_header file
Upload the page specific content.
Call the sample_footer file.

1
2
3
4
[include file="template/sample_header.php"]
Sub-Page Title
Here is the specific content of this page:
[include file="template/sample_footer.php"]

Tips:
1. Do remember to save all of your files with the .php extension.
2. Upload sample_header & sample_footer .PHP file help of FTP in wp-content/themes/twentyeleven or twentytwelve as your current theme
3. Follow the same process as sample_header and a sample_footer in case you want to upload more files.
4. Couple this with the use of a style sheet to change style within the page exclusive content as well.

twitter How to Include PHP file to WordPressfacebook How to Include PHP file to WordPressgoogle How to Include PHP file to WordPresslinkedin How to Include PHP file to WordPresspinterest How to Include PHP file to WordPressreddit How to Include PHP file to WordPressstumbleupon How to Include PHP file to WordPresstumblr How to Include PHP file to WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *


five + 3 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>