• Hi

    I have created a new theme with pages in my WP blog but all pages go to the same place?! I have set my front-page and my blog page but don’t understand why when I click on a page, it’s the same one throughout the site?!

    Please help

    here is my site:
    site here

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter jbiddulph

    (@jbiddulph)

    it’s just showing the last page title that I have created?!

    That means the main query is overwritten somewhere. Probably because of a query_posts that’s being used and isn’t getting reset (to reset the main query and display the correct content).

    Thread Starter jbiddulph

    (@jbiddulph)

    hmm what do I do?

    Thread Starter jbiddulph

    (@jbiddulph)

    I just tried custom fields, that didn’t work, I have now just recreated all my pages and now it still doesn’t work but it’s also put -2 next to my page in the URL?!

    What’s going on?!

    Check your page.php, if you are not the developer of the theme check twenty ten’s page.php and try to copy the code.if you made any mods re install your theme(delete the mods) and try again..

    Thread Starter jbiddulph

    (@jbiddulph)

    here is the code for my PAGE.PHP

    <?php
    
    get_header();
    the_post();
    
    ?>
    <div id="maincontent" class="page">
    <?php tfa_breadcrumb();?>
    	<div <?php post_class() ?>>
    		<h1 class="entry-title"><?php the_title() ?></h1>
    		<div class="entry-content">
    			<?php the_content() ?>
    		</div>
    	</div>
    
    </div>
    
    <?php get_footer() ?>

    Please use pastebin.com if posting more than 10 lines of code.

    What are your permalinks settings? When you set up permalinks it normally changes your .htaccess file or asks you to – did that happen?

    i just noticed that your WP site url has an index.php in it.Why is that?

    Thread Starter jbiddulph

    (@jbiddulph)

    the site is not live yet

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The -2 on pages is becuase there’s a page with that name already in the database. Can’t have both. If you delete the old ones, you have to empty the trash.

    Thread Starter jbiddulph

    (@jbiddulph)

    thanks, still can’t get page title and content for selected page?!

    That means the main query is overwritten somewhere. Probably because of a query_posts that’s being used and isn’t getting reset (to reset the main query and display the correct content).

    from the first reply by @hiranthi Molhoek-Herlaar

    have you tried to follow that up?

    now try and reset the query of whatever slidehow you have in the header;

    try with wp_reset_query();

    Thread Starter jbiddulph

    (@jbiddulph)

    YAY finally!!!! so why did that happen??? I messed about my my website all day sunday, probably wasted 6 hours?!

    Thank you sooo much! x

    If query_posts is getting used somewhere it’s overwriting the main query results ($wp_query). In order to get them back (and display the correct page contents) it needs to be reset (so that $wp_query has the main query as contents again).

    Nacin had a great presentation about this last weekend @ WordCampNL ?? (he does have slides online somewhere, so if you want to know more about it you can check that out).

    Oh and could you please mark this as resolved? ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘All pages are the same?’ is closed to new replies.