Using the_meta() in a single-{slug}
-
Hello,
I’m trying to use the_meta() in my single custom post ( single-{slug}.php ) and worpdress just won’t echo it. This is the code I’m using:
<h2><?php $key="Expo-Subtitle"; $value_expo =get_post_meta($post->ID, $key, true); echo $value_expo;?></h2>
While it’s working great in the category page (Where it is running within the Loop), it just won’t work in single.php.
I’m guessing it may be because single post pages are outside the loop.
Does anyone now how could I fetch the post meta from the single post page? the_title() and the_content() work great, but it seems to work in a diferent way when it’s the_meta().
Any key or guidance here would be really helpfull!
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using the_meta() in a single-{slug}’ is closed to new replies.