I have built a custom page.php template. Quite simple, basically:

<?php get_header(); ?>

<?php get_sidebar(); ?>

<?php the_post(); ?>

<h1><?php the_title(); ?></h1>

<?php get_footer(); ?>

I have produced a couple of pages, and when I visit their url, I simply obtain the same page title.

I educate yourself within the documentation, also it states to make use of the_title() and the like only if in "the loop".

So most probably, I am just being proven page one within the "array".

Can there be in whatever way I recieve obtain the contents of merely one page in line with the url?

Edit: Actually, must i even have to do this? Refering to example templates, it appears like I am doing everything right?

For any custom page template please make use of the following to obtain everything correct

/* Template name: My custom template */


    if ( have_posts() ) while ( have_posts() ) : the_post();



During my sidebar I had been utilizing a custom query.

It was known as prior to trying to gain access to the primary page content, without resetting.

When you are performing a custom query you have to totally reset after you have finished your loop like so:

$originalPost = $post;
$sidePosts = get_posts($queryArgs);
foreach($sidePosts as $post) {
    // echo it out like a normal post.
$post = $originalPost;

or if you work with query_posts() (that you simply should not inside a sidebar):


That will take your publish to it's previous value.