How get one page?

Sometimes it is necessary to have page content in WordPress. This can be done quite easily. Use this code

 
 $pageId = 68;

			global $wpdb;
			$sql_query = 'SELECT DISTINCT * FROM ' . $wpdb->posts .
			' WHERE ' . $wpdb->posts . '.ID=' . $pageId;
			$posts = $wpdb->get_results($sql_query);
			if(!empty($posts))
			{
				foreach($posts as $post)
				{
					print_r(nl2br($post->post_content)); 
				}
			}

There $pageId, use your page ID, which content you want to see.

1 comment

  1. Pingback: Alexander6

Leave a Reply

Your email address will not be published. Required fields are marked *