<?php
if(is_category()) {
    $cid = get_query_var('cat');
    $content = do_shortcode(category_description( $cid ));
}
elseif (is_tax()) {
    $content = do_shortcode(term_description());
    $content = parseAmpContent($content);
}
elseif (is_page() or is_home()){
    global $post;
    if(IS_AMP) {
        $content = carbon_get_post_meta( $post->ID, 'amp_content' );
        if(empty($content)) {
            $content = $post->post_content;
        }
        $content = do_shortcode($content);
        $content = parseAmpContent($content);
    } else {
        $content = do_shortcode($post->post_content);
        $content = parseAmpContent($content);
    }
}
else {
    global $post;
    $content = do_shortcode($post->post_content);
    $content = parseAmpContent($content);
}
if(!empty($content)) include 'view.php';