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've created a custom post type "projects" that has a meta box for additional information (client name, type of project, budget, etc). I'd like to be able to display this information on the front-end.

The custom post type is available to be added to custom menus if desired ('show_in_nav_menus' => true), but when you view each project, all you see is the title and the description.

Ideally, I'd like the meta data to show with the title and description in whatever theme that is being used for the site, but I don't know if that's possible.

Is there a way to display the meta box information on the front-end without having to either (a) touch the theme files (since themes can change so I don't want to do that) or (b) calling my own function that returns my own page template for the projects (because then it won't use the theme that is active)?

Thanks!

ETA - This is all done within my plugin.

share|improve this question
1  
Take a look at get_post_custom(). –  kaiser Apr 17 '12 at 23:40
    
Thanks, I have retrieved the meta box data to display. But how do I get it in the content area through my plugin? I'm using wp_head in my add_filter at the moment to see what I'm echoing out, but obviously I want it within the content area after the title. –  CourtFantinato Apr 18 '12 at 2:26
1  
Nevermind, this has been solved. Use 'the_content' of course. :) –  CourtFantinato Apr 18 '12 at 5:31
1  
Add this as answer. You can mark it as solution later, so the Q doesn't stay open. Thanks. –  kaiser Apr 18 '12 at 12:39
    
Yes I tried to earlier, but I had to wait to be allowed to do so. –  CourtFantinato Apr 18 '12 at 15:56

1 Answer 1

up vote 0 down vote accepted

Solution:

Inside a function, retrieve meta box field values using get_post_custom_values() and added it to $content passed to the function. Use 'the_content' in the add_filter.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.