نمایش محتویات یک برگه در وردپرس

<?php

$page_id = 1086; // 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. By default, this will return an object.

echo ‘<h3>’. $page_data->post_title .'</h3>’;// echo the title

echo apply_filters(‘the_content’, $page_data->post_content); // echo the content and retain WordPress filters such as paragraph tags.

//Origin: http://wordpress.org/support/topic/get_pagepost-and-no-paragraphs-problem

?>

4 سال پیش

پاسخ دهید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *