WordPress.org

Ready to get started?Download WordPress

Forums

Include page (5 posts)

  1. BoBB
    Member
    Posted 9 years ago #

    Whats the easiest way in wp-1.5 to include a php page instead of the blog postings? There must be some place in the default theme that calls a certain page from the theme directory but I can't find it. Any help is much appreciated.

  2. YardOBeef
    Member
    Posted 9 years ago #

    The WordPress Codex is your friend. Read about Pages and scroll down to "Pages can use Different Templates".

  3. BoBB
    Member
    Posted 9 years ago #

    I don't want to use a different template for a wordpress page, I want to be able to include a different php page instead of the one that calls the posts.

  4. BoBB
    Member
    Posted 9 years ago #

    Ah, nevermind, I had to read that a few times before I could understand it heh

  5. trevorturk
    Member
    Posted 9 years ago #

    This is a useful code snippet for making an "edit this page" link to whatever page you're including. You'll need to change the number used in this example, unless the page you're including has an ID of "2".


    if(is_home()) { // if this is the home page (in this example, i'm including a post with id=2)
    $original_post = $post; // save the current $post for later
    $post = $wpdb->get_row('SELECT * FROM wp_posts WHERE ID="2"'); // get the page you're including
    }
    edit_post_link('Edit this Page', '<li>', '</li>'); // echo the edit link
    $post = $original_post; // set $post back to the original value

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.