jonathanclarke
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: the_ID and $wp_query->post->ID always return the same numberI’ll try that…
Forum: Fixing WordPress
In reply to: the_ID and $wp_query->post->ID always return the same numberNope, didn’t work:
Sidebar
global $post; $side_ID = $post->ID; global $bpl_post_ID; echo '<h4>Post ID</h4>'; echo 'the_ID: '.the_ID().''; echo 'get_the_ID: '.get_the_ID().''; echo 'bpl_post_ID: '.$bpl_post_ID.''; echo 'bpl_post_ID2: '.$bpl_post_ID->ID;
Content
global $wp_query; $bpl_post_ID = $wp_query->post->ID; echo $bpl_post_ID; global $bpl_post_ID;
Forum: Fixing WordPress
In reply to: the_ID and $wp_query->post->ID always return the same numberTrying that right now…
Forum: Fixing WordPress
In reply to: the_ID and $wp_query->post->ID always return the same numberOK, here’s what I want to achieve…
I want to display custom field (meta) data in the sidebar when viewing the single post view. The data should be specific to the post viewed.
To get the custom field functions to work I need to feed them the current post ID.
For some reason I’m unable to echo out the current post ID from within the sidebar.
Here is my sidebar code:
global $post; $side_ID = $post->ID; echo '<h4>Post ID</h4>'; echo 'the_ID: '.the_ID().''; echo 'get_the_ID: '.get_the_ID().''; echo 'bpl_post_ID: '.$bpl_post_ID.''; echo 'side_ID: '.$side_ID;
Here is my content code:
global $wp_query; $bpl_post_ID = $wp_query->post->ID; echo $bpl_post_ID; global $bpl_post_ID;
The content code displays the correct post ID, but the sidebar code doesn’t.
Forum: Fixing WordPress
In reply to: the_ID and $wp_query->post->ID always return the same numberSo the sidebar is in The Loop?
Forum: Themes and Templates
In reply to: Post meta data in sidebar incompleteI’m trying to do a similar thing and failing.
Essentially how do you get post specific meta data into the sidebar?
Forum: Fixing WordPress
In reply to: Multiple tag / category queriesYou can get round this by using custom fields and this great plugin:
https://scribu.net/wordpress/custom-field-taxonomies/cft-0-5.html
Forum: Fixing WordPress
In reply to: Multiple tag / category queriesI did, but I didn’t get a reply…
Forum: Fixing WordPress
In reply to: Multiple tag / category queriesHello!?!
Forum: Fixing WordPress
In reply to: Multiple tag / category queriesAny suggestions?