WordPress.org

Ready to get started?Download WordPress

Forums

All pages are the same? (16 posts)

  1. jbiddulph
    Member
    Posted 2 years ago #

    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

  2. jbiddulph
    Member
    Posted 2 years ago #

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

  3. Hiranthi
    Member
    Posted 2 years ago #

    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).

  4. jbiddulph
    Member
    Posted 2 years ago #

    hmm what do I do?

  5. jbiddulph
    Member
    Posted 2 years ago #

    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?!

  6. comediann
    Member
    Posted 2 years ago #

    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..

  7. jbiddulph
    Member
    Posted 2 years ago #

    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() ?>
  8. kmessinger
    Volunteer Moderator
    Posted 2 years ago #

    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?

  9. comediann
    Member
    Posted 2 years ago #

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

  10. jbiddulph
    Member
    Posted 2 years ago #

    the site is not live yet

  11. 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.

  12. jbiddulph
    Member
    Posted 2 years ago #

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

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

    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();

  14. jbiddulph
    Member
    Posted 2 years ago #

    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

  15. Hiranthi
    Member
    Posted 2 years ago #

    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).

  16. Hiranthi
    Member
    Posted 2 years ago #

    Oh and could you please mark this as resolved? :-)

Topic Closed

This topic has been closed to new replies.

About this Topic