• Resolved johnjf

    (@johnjf)


    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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    https://codex.www.ads-software.com/Theme_Development
    https://codex.www.ads-software.com/The_Loop
    https://codex.www.ads-software.com/Template_Hierarchy

    Thread Starter johnjf

    (@johnjf)

    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.

    Thread Starter johnjf

    (@johnjf)

    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.

    Thread Starter johnjf

    (@johnjf)

    found out the error myself

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress posts showing up in all pages, why?’ is closed to new replies.