I am creating many pages and store them into the database. I am first styling them and than storing them. The idea is to use page.php to check the page id and display the needed post. This is all good, but I have many pages in the website. WHich means I have to perform the following statement many time.
<?php
if(is_page(14)) {
global $wpdb;
$findContent = $wpdb->get_var("SELECT post_content FROM wp_posts WHERE post_title = 'Why ......'");
get_template_part( 'localnav' );
echo $findContent;
}
?>
My question is is that a good rpactice or is there a better idea? Note there asome pages which look alike, maybe I can create catogories, but is it possible to select part of the content and put it in a div for example?