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).
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..
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?
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.
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();
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? π