WordPress.org

Ready to get started?Download WordPress

Forums

showing a php page on a WP page! (5 posts)

  1. unlimited
    Member
    Posted 5 years ago #

    Hi,
    The problem is:
    i have made a new WP page on my blog called Hi and i want to show the contents of this page lol.php on that Hi page.

    http://www.wp.com/lol.php
    want to show it on
    http://www.wp.com/?page_id=1

    How do i add that!?

  2. Dagon Design
    Member
    Posted 5 years ago #

    You could either use a plugin like PHP Exec, which allows you to put PHP code directly into a page, or create a custom page template, and in the template file for that page, either add your PHP code directly, or just have it include lol.php

    I prefer the custom page template method myself, and it is very easy to do.

    You basically just duplicate your template's page.php file, call it something like page-lol.php, and add a header like this:

    <?php
    /*
    Template Name: lol
    */
    ?>

    Then when editing your page, just specify the page template to use.

    More info: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  3. unlimited
    Member
    Posted 5 years ago #

    if i want to address that lol.php on a WP page! What shall i write in the WP page after installing "PHP Exe"?

    <? php .... ???

  4. lelandf
    Member
    Posted 5 years ago #

    You could try something like:

    <?php include "lol.php"; ?>

    You may have to change that depending on where the lol.php file is stored.

  5. unlimited
    Member
    Posted 5 years ago #

    if my blog is:

    root/index.php
    root/wp-admin

    and
    lol pages is on

    root/lolpage/lol.php

    will the code be like:
    <?php include "../lolpage/lol.php"; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.