get Page meta
-
I have a custom page template where I want to use the data from a custom field. The code I’ve used worked fine on the single post templates but inside the page template is not working. Instead of getting the content of the page custom field I’m getting the content of a single post custom field. Here is the code:
<?php { $sidebarBoxcontent1 = get_post_meta($post->ID, 'sidebarBox_content1', true); if($sidebarBoxcontent1 != ''){ echo '<h4>'.$sidebarBoxcontent1.'</h4>'; } ;} ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘get Page meta’ is closed to new replies.