WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Live site.

I've got a custom theme that is giving me slight issues with shortcodes- they don't work. When I switched back to the default theme, the shortcodes worked fine. What do I need to look for in my custom theme to be the culprit?

If it matters, the shortcodes are for Contact Form 7 and Bookings plugins.


Template Name: Contact

<?php get_header(); ?>

<h2>Tell us, what's on your mind? Questions, comments, hellos- share them below.</h2>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?> 

<?php get_footer(); ?>

Any and all help is greatly appreciated.

share|improve this question
off my head is to make sure your theme has 'wp_head();` in header.php and wp_footer(); in footer.php – Bainternet Jul 7 '12 at 14:13
wp_head is just above the closing </head> in header.php and wp_footer is just after the opening <div id="footer"> in footer.php – user1255049 Jul 7 '12 at 14:20
Set WP_Debug to TRUE in wp-config and see if you get any errors. Then add those to your question. – mrwweb Jul 7 '12 at 15:18
debug shows no errors – user1255049 Jul 7 '12 at 15:27
is it particular page template? does it have the_content()? doesn't appear to be displaying any text.. can you show text other than the shortcode? do you have any improperly closed html in the html view? – helgatheviking Jul 7 '12 at 16:47
up vote 3 down vote accepted

Your problem is the loop itself. As others suspected, you don't have the_content() to display the page content.

Change your loop to this and that should fix your problem:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?> 
share|improve this answer
ah, i knew it had to be something simple i was overlooking. thank you. – user1255049 Jul 7 '12 at 19:05
yup, need the_content()!! glad you found the solution. – helgatheviking Jul 7 '12 at 19:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.