Avi Schoenbrun
Member
Posted 2 months ago #
Hi. I'm relatively new at php coding. I have a bit of code that sets the $post value so that a list of random posts is displayed. Now this plugin is showing a random post instead of the current one (though it works great otherwise!) How do I reset the $post value so that the plugin will, once again, show the current post?
Thanks in advance
http://wordpress.org/extend/plugins/breadcrumb-navxt/
Avi,
Just save a copy of the $post variable before randomizing it, the restore it to the original state after the random post is used. Adding something like $postBK = $post; before your randomizing code and $post = $postBK; afterwords should do the trick. Though it may be better to use a different variable for randomization rather than $post.
-John Havlik