How to consolidate multiple static page templates into one dynamic one?

Personally, I build everything within index.php of each template. I then do conditional checks.

Example:

if(is_front_page()){
    // Home page layout
} elseif(is_page()){
    // General page layout
    if(is_page('contact')){
        // Page layout specific to the contact page
    } elseif(is_page('about')){
        // Page layout specific to the about page
    }
}

Read more on conditional tags.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)