Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was attempting to add this Flash Count Down plugin.

The shortcode works fine in preview:

enter image description here

But when published the shortcode is rendered as text:

enter image description here

Is there a general solution to this problem or do I have to get someone from the publisher to answer this question?

They have apparently abandoned supporting these as their link is a 404: http://premiumcoding.com/premiumcode-forum/wordpress-plugins-group1/wordpress-plugins-support-forum2/

Here is the template index file:

<?php
/*
Template Name: Index Page
*/
?>
<?php get_header(); ?>

<div id="content" class="content content-group content-index">
    <div class="pad">
        <div class="post-group">
            <?php get_template_part('loop','index'); ?>
        </div>
    </div>
</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Here's the main index file:

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
?>

loop.php:

<?php while (have_posts()) : ?>
    <?php the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class('append-clear'); ?>>
        <div class="title">
            <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
        </div>

            <?php 




            // padd_theme_share_button(); ?>
            <?php //the_excerpt();?>


    </div>
<?php endwhile; ?>
share|improve this question
2  
where do you apply this shortcode? the posts? the sidebar? header? footer? –  tpaksu Mar 23 '12 at 15:44
    
Currently it is only applied to a single post which is included as part of the home page. Thanks! –  jerrygarciuh Mar 23 '12 at 16:16
add comment

1 Answer

up vote 1 down vote accepted

find the function that generates the output, or the output itself if it's hardcoded in your page and add this function to it:

<?php echo do_shortcode( $content ) ?>

if your content is generated through the_post(), it'll be:

<?php echo do_shortcode( the_post() ) ?>

or the_excerpt:

<?php echo do_shortcode( the_excerpt() ) ?>
share|improve this answer
    
I tried this and found that if the post is viewed by itself the code is rendered but on the home page WP comments out the PHP and leaves it in. Any thoughts on that? Thanks! –  jerrygarciuh Mar 25 '12 at 2:08
1  
can you post that part of code in your index.php? not single.php. –  tpaksu Mar 25 '12 at 2:10
1  
ok. there should be a file named loop-index.php in your theme directory. edit it and apply the shortcode function I wrote in the answer. –  tpaksu Mar 25 '12 at 16:46
1  
maybe he/she converted it to a custom function and added to functions.php –  tpaksu Mar 26 '12 at 10:24
1  
You're welcome. –  tpaksu Mar 28 '12 at 1:06
show 3 more comments

Your Answer

 
discard

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.