blakekr
Member
Posted 6 years ago #
get_post_custom_values works brilliantly in my single.php, but I can't get a value out of it when I try to use it in my sidebar. I'm guessing it's designed to work within The Loop?
Is there a way I can retain this value and use it again in my sidebar, or use get_post_custom_values outside of the loop?
The problem with being outside of the loop is that get_post_custom_values() doesn't know which post you want values from. Try creating a new loop in your sidebar. See the codex here for instructions on creating such a loop.
blakekr
Member
Posted 6 years ago #
blakekr
Member
Posted 6 years ago #
Okay, I'm still having a little trouble with this because it stops my "breadcrumb" plugin from working ... my sidebar loads before my main content, and the breadcrumb plugin is supposed to be "out of the loop." I think the page you showed me offers some workarounds, but I haven't mastered them yet. I'll post back later as I try some more ....