WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Calling PAGE content into Index.php (3 posts)

  1. pshero
    Member
    Posted 5 years ago #

    Hey gang. I'm hoping one of you PHP geniuses can help me out. I'm trying to replace the standard index.php content area (where the most recent posts are typically displayed) with the content from one of my wordpress PAGES (yes a particular PAGE, not a post). I'm crap at coding php, and I'm wondering if anyone could help show me how this script should be written.

    Thanks a million!

  2. Technokinetics
    Member
    Posted 5 years ago #

    You may be better off just setting that Page as the home page of your site through the Settings > Reading screen in the dashboard.

    If not, then add <?php query_posts('page_id=1'); ?> (replacing "1" with the appropriate Page ID) just before the loop (which starts with <?php while (have_posts()) : the_post(); ?>) in your index.php theme file.

    - Tim

  3. pshero
    Member
    Posted 5 years ago #

    PERFECT! Works like a charm. Also thanks for the tip on the start page designation feature, I never even knew that was there!

    Thank you so much Technokinetics!

Topic Closed

This topic has been closed to new replies.

About this Topic