0

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; ?>
2
  • 2
    where do you apply this shortcode? the posts? the sidebar? header? footer?
    – tpaksu
    Mar 23, 2012 at 15:44
  • Currently it is only applied to a single post which is included as part of the home page. Thanks! Mar 23, 2012 at 16:16

1 Answer 1

1

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() ) ?>
7
  • 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! Mar 25, 2012 at 2:08
  • 1
    can you post that part of code in your index.php? not single.php.
    – tpaksu
    Mar 25, 2012 at 2:10
  • Posted main index and template index files. Thanks for any advice? Mar 25, 2012 at 15:55
  • 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, 2012 at 16:46
  • 1
    maybe he/she converted it to a custom function and added to functions.php
    – tpaksu
    Mar 26, 2012 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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