PowenKo, WordPress Tutorial 80-1, Category, get current page id in wordpress

November 26, 2011   ·   0 Comments

get current page id in wordpress

$this_page_id = get_query_var('page_id')

In index.php etc. page is

$post

$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");

get current page conetnt


$this_page_id = get_query_var('page_id');
$page_id = $this_page_id; // 123 should be replaced with a specific Page's id from your site, which you can find by mousing over the link to edit that Page on the Manage Pages admin page. The id will be embedded in the query string of the URL, e.g. page.php?action=edit&post=123.
$page_data = get_page( $page_id ); // You must pass in a variable to the get_page function. If you pass in a value (e.g. get_page ( 123 ); ), WordPress will generate an error. 

//echo "AAAAA";
echo $content = apply_filters('the_content', $page_data->post_content); 

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Wordpress99

Wordpress

Amazon

adsbygoogle

Recent Posts

Categories

Amazon