For the moment when I want to show a single post without using a loop I use this:
<?php
$post_id = 54;
$queried_post = get_post($post_id);
echo $queried_post->post_title; ?>
The problem is that when I move the site, the id's usually change. Is there a way to query this post by slug?
a less expensive and reusable method
As wordpress api has changed, you can´t use get_posts with param 'post_name'. I´ve modified Maartens function a bit:
From the WordPress Codex:
WordPress Codex Get Posts
How about?