Wordpress get_page() function

Well this is the first time that I am having a hard time debugging this simple Wordpress get_page() function:

$p = get_page(2); // error : Only variables can be passed by reference

it has to be like this:

$n = 2;
$p = get_page($n);

Getting the title and content is easy..

_e($p->post_title)

_e($p->post_content)

I know it sucks but I hope it helps!

4 Responses to “Wordpress get_page() function”

  1. blogiskewl says:

    Hi, I recently started a bloghosting platform (based on wordpress MU) and when I stumbled your blog I paid attention to your theme (looking good) so I was wondering can you tell me is it custom made theme or one of those free ones? thanks in advance! regards, blogiskewl

  2. admin says:

    My themes are custom made. I made them for my clients.

  3. Ample says:

    This really sucks – I mean me and my php knowledge. This is the first time I’m doing a wordpress customisation for a client and your article saved my day.

    thanks a bunch!

  4. juks says:

    This really sucks!!! I did not even know that I can get the post title and content by just using this _e($p->[field_name])…

Leave a Reply