php echo not referencing met content
-
Hello everyone,
my site is here:http://www.joyousvacations.com
I am new to PHP, been trying to figure this out for a while now.
I have a metaboxes.php file that has some arrays in it and here is the code i am trying to reference:
?php // Include & setup custom metabox and fields $prefix = '_ct_'; // start with an underscore to hide fields from custom fields list add_filter( 'cmb_meta_boxes', 'ct_metaboxes' ); function ct_metaboxes( $meta_boxes ) { global $prefix; $meta_boxes[] = array( 'id' => 'rentalname', 'title' => 'Rental Name', 'pages' => array('listings'), // post type 'context' => 'normal', 'priority' => 'high', 'show_names' => false, // Show field names on the left 'fields' => array( array( 'name' => 'Rental Name', 'desc' => 'Type the name of your rental here.', 'id' => $prefix . 'rentalname', 'type' => 'text' ), ) );
I also have a single-listings.php file that I am trying to pull the Rental Name and display on the site:
<?php echo get_post_meta($post->ID, "_ct_rentalname", true); ?>
All I get is empty space, can someone let me know what I am doing wrong? Any help would be appreciated.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘php echo not referencing met content’ is closed to new replies.