Simple question, but couldn’t find the answer.
When the function ‘enkelpost’is called anywhere in WP the passed value($one_p) is gonne be the post ID displayed. But how to put this in the function itself. This is in the functions.php:
<?php
function enkelpost($one_p)
{
query_posts('p= $one_p '); //how to make line this work?
while (have_posts()) : the_post();
global $more; $more = FALSE;
the_content('Read more...');
endwhile;
}
?>
Lets say we want the singe post with id 150:
<?php enkelpost('150') ?>
Variables are not parsed when they are enclosed with single quote, put them in double quotes.
OR
Do not use quotes for variables at all