WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress posts showing up in all pages, why? (6 posts)

  1. johnjf
    Member
    Posted 2 years ago #

    I was just going through the theme I'm building and noticed that the pages I made aren't showing the content posted in that page, all that shows up are the posts that are created. How come it's doing this and how do I get the content from the page to show up instead of the posts?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    How come it's doing this

    you might know best - as you haven't given any info for anybody else to check this.

    check 'the loop' and any query before the loop;
    or create a page.php without any custom query before the loop.

    http://codex.wordpress.org/Theme_Development
    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/Template_Hierarchy

  3. johnjf
    Member
    Posted 2 years ago #

    I'm using localhost xampp to work on my theme. I'm following a tutorial from amberwienburg using her hyjinks template.

    I have this in my index.php

    <?php query_posts('pagename=Home'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
        	<div id="content_main">
    		<h2><?php the_title();?></h2>
    		<?php the_content();?>

    and in my page.php file I just have

    <?php if (have_posts()) ; ?>
    
    	<?php while (have_posts()) : the_post(); ?>
            <div id="content_wrap">
    
        	<div id="content_main">
    		<h2><?php the_title();?></h2>
    		<?php the_content(); ?>

    Sorry I'm new to wordpress.

  4. johnjf
    Member
    Posted 2 years ago #

    Well I've been trying to figure out the problem going back and forth editing page.php and index.php, checking my header, etc. I can't seem to find the problem.

    I took away query_posts('pagename=Home');

    edited what ever else and still all I'm getting is recent posts showing up in my pages instead of content pages.

  5. johnjf
    Member
    Posted 2 years ago #

    found out the error myself

  6. MorenaB
    Member
    Posted 2 years ago #

    Why don't you explain what you did so you can help others out who may have the same issue?

Topic Closed

This topic has been closed to new replies.

About this Topic