johnjf
Member
Posted 3 months 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?
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
johnjf
Member
Posted 3 months 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.
johnjf
Member
Posted 3 months 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.
johnjf
Member
Posted 3 months ago #
found out the error myself
MorenaB
Member
Posted 3 months ago #
Why don't you explain what you did so you can help others out who may have the same issue?