Shortcode not working
-
Hi, I have just installed and created shortcode [related_posts] when i put this in editor it just returns [related_posts]
snippet code below, Anything i’m missing? Thanks!
`<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo ‘<h2>Related Articles</h2>’;
$first_tag = $tags[0]->term_id;
$args=array(
‘tag__in’ => array($first_tag),
‘post__not_in’ => array($post->ID),
‘posts_per_page’=>3,
‘caller_get_posts’=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
?>
” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?>
<p class=”single-cat-date”><?php the_category();?> <?php echo get_the_date(); ?></p>
<?php echo do_shortcode(‘[rt_reading_time label=”” postfix=”MIN <span>READ</span>” postfix_singular=”MIN <span>READ</span>” post_id=”‘ . $post->ID . ‘”]’)?>
<?php
endwhile;
}
wp_reset_query();
}
?>’The page I need help with: [log in to see the link]
- The topic ‘Shortcode not working’ is closed to new replies.