Wordpress shortcodes only working in posts, not pages. Custom theme

Viewed 6592

I'm building a theme for a friend but some some reason I can't get shortcodes to work in Pages. They only work in Posts.

My page.php file is very simple at the moment:

<?php get_header(); ?>
<?php
if (have_posts()) :
    while (have_posts()) : the_post();
        echo '<div class="hero-unit"><div class="container"><h1>'.get_the_title().'</h1></div></div>';
        echo '<div class="container clearfix" id="main-content">'.get_the_content().'</div>';
    endwhile;
endif;
?>
<?php get_footer(); ?>

This is working fine but is just displaying the shortcode as text. IE I am trying to use the shortcode [wp_sitemap_page] the page just renders '[wp_sitemap_page]' in text.

What could be the issue?

1 Answers
Related