Hi everyone,
I'm sure this is a simple fix but it may take a minute to understand what I'm trying to achieve.
Here is my code, as you can see it's for a shortcode:
function verticalnav_func( $atts ) {
extract( shortcode_atts( array(
'category' => '0',
), $atts ) );
?>
<div id="TabbedPanels2" class="VTabbedPanels">
<ul class="TabbedPanelsTabGroup">
<!-- Repeat for each content -->
<?php
$args=array(
'showposts' => 8,
'category__in' => 6,
'orderby' => 'post_date',
'order' => 'ASC'
);
$posts=get_posts($args);
if ($posts) {
foreach($posts as $post) {
setup_postdata($post); ?>
<li class="TabbedPanelsTab" tabindex="0"><?php the_title(); ?></li>
<?php
} // foreach($posts
} // if ($posts
?>
<!-- End repeat -->
</ul>
<div class="TabbedPanelsContentGroup">
<!-- Repeat for each content -->
<?php
$args=array(
'showposts' => 8,
'category__in' => 6,
'orderby' => 'post_date',
'order' => 'ASC',
'caller_get_posts'=>1
);
$posts=get_posts($args);
if ($posts) {
foreach($posts as $post) {
setup_postdata($post); ?>
<div class="TabbedPanelsContent"><?php the_content(); ?></div>
<?php
} // foreach($posts
} // if ($posts
?>
<!-- End repeat -->
</div>
<div style="clear: both;"></div>
</div>
<?php
}
add_shortcode( 'vertical-navigation', 'verticalnav_func' );
?>
The shortcode [vertical-navigation] is placed within a post called "NVQ's", and when called is meant to display a vertical navigation list of posts within category 6.
HOWEVER,
It is getting the_content correctly from each of the posts within category 6, but when it attempts to get_title it's just returning "NVQ's" which is the title of the current page.
Any thoughts?