Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have added the custom field which displays in the custom post type "portfolio" just fine.

// Add more custom field
    function woo_metaboxes_add($woo_metaboxes) {

        // Check for post type = portfolio
        if ( get_post_type() == "portfolio" || !get_post_type() ) {

            $woo_metaboxes['custom_field'] = array (  "name" => "custom",
                                        "label" => "Custom field",
                                        "type" => "text",
                                        "desc" => "description");

        }  

        return $woo_metaboxes;

    }

I can save the data in the "portfolio" custom post type, no issues there. The problem I'm having is displaying of the data on the page.. I'm currently using:
<?php echo get_post_meta($post->ID, 'custom_field', $single = true); ?>
within the loop through portfolio items (each portfolio item is a custom post).

I can't get the text I entered in the custom field to show up on the page. Any ideas?

share|improve this question
    
What are you getting? Have you checked that the data is saved in database correctly with expected key? –  Rarst Sep 19 '13 at 13:13
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.