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'm trying to embed the nivo slider into a wordpress theme so each slide shows a set of recent image pots and excerpt. At this moment I can get it to show the images but not the post excerpt.

<div id="slides">
<?php $my_query = new WP_Query('showposts=5&category_name=featured'); while ($my_query->have_posts()) : $my_query->the_post(); ?> 
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
<img src="<?php echo get_post_meta($post->ID, 'nivoimage', true); ?>" alt="" title="<?php the_title(); ?>" />
</a>
<?php endwhile; ?>
</div>
<div class="clear"> 

Ideally I'd like the excerpt to wrapped in a div so I can style it in css. Does anyone have any ideas?

I should maybe also mention that I'm using the mimbo theme and that doesn't want to accept any kind of news slider plugin.

Thanks,


Editors Note: Links to template pastes and such:

share|improve this question
add comment

closed as too localized by toscho Jul 14 '12 at 21:33

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

I'm not quite clear if your saying you can call the excerpt but it's not showing up or if you don't know the function to show the excerpt.

If it's the former it might be a CSS issue, if the latter the following should do the trick:

<div class="content-summary">
     <?php the_excerpt(); ?>
</div>

You can read more about the_excerpt function in the WordPress Codex.

share|improve this answer
    
Thanks Jonathan, It's more former, I'm not sure how to integrate the_excerpt part into the above code so that the excerpt changes along with the slide? –  Nsokyi Sep 23 '11 at 12:00
    
It's hard to diagnose without seeing the relevant javascript & css. Just wrapping the link, image and excerpt in a div with the relevant class (maybe .slide?) should be all you need to do. –  Jono Warren Sep 23 '11 at 12:27
    
ok cool, here's my index page [link]pastebin.com/vE9hvT37 the header [link]pastebin.com/5Rq9na0d and the get_template_part slides [link]pastebin.com/cuhHWMHG –  Nsokyi Sep 23 '11 at 12:56
    
and the template part is called jFlowControl it should refer to nivo slider but I haven't got round to renaming it yet. –  Nsokyi Sep 23 '11 at 12:57
add comment

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