Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   Breadcrumbs plugins always show first post (http://forum.bytesforall.com/showthread.php?t=992)

tikdi Mar 28, 2009 10:49 AM

Breadcrumbs plugins always show first post - Theme secondary looping
I tried using Breadcrumbs ( 2 different plugins) by inserting the relevant code in index.php. (Got the exact position from this forum, thanks!)

The Breadcrumbs menu shows perfectly, but the problem is it always shows the 'last' post in any post.

I managed to find the reason for this as under:


This is caused by a secondary loop in your theme which is not behaving “nicely”. The secondary loop should not modify the variable $post, and if it does, the variable $post should be returned to it’s original state afterward. At the moment, Breadcrumb NavXT depends on the $post variable being correct.
Please guide me how to correct the loop...

Flynn Mar 30, 2009 08:03 AM

I am not using a 2nd loop as far as I can see but one of the How-Tos here on the forum may have included a 2nd loop. Anyways, try putting
PHP Code:

<?php $wp_query->rewind_posts(); ?>

right before the breadcrumb code.

tikdi Mar 31, 2009 09:29 PM

Thank you Flynn,
That worked perfectly.
Anand. :)

All times are GMT -6. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.