Custom Post Types

edited November 2014 in Theme support
Hi, 
I'm using a recipe Plugin that creates has a custom post type called recipes. I've worked with their support to get this integrated into Betheme but i'm wondering if there is any documentation from Betheme on how what the best method to include a custom post type to work with this theme. 2 issues i'm still struggling with :

1. Getting the featured image to appear on the post
2. getting the custom post type to adhere fully to the theme layout (i.e. i can't get the sidebar layout to appear on recipe posts)

here's what i've done so far;

sidebar.php 
LINE 11 - Show sidebar for posts and recipes 
FROM 
if( get_post_type()=='post' && is_single() && mfn_opts_get('single-sidebar') ){

TO 
if( (get_post_type()=='post' || get_post_type()=='recipe') && is_single() && mfn_opts_get('single-sidebar') ){

functions\theme-head.php 
LINE 506 - Show sidebar for posts and recipes 
FROM 
if( get_post_type()=='post' && is_single() && mfn_opts_get('single-layout') ){

TO 
if( (get_post_type()=='post' || get_post_type()=='recipe') && is_single() && mfn_opts_get('single-layout') ){

functions\meta-post.php 
LINE 126 - Duplicate to add post options metaboxes to recipes as well 
FROM 
function mfn_post_meta_add() { 
global $mfn_post_meta_box; 
add_meta_box($mfn_post_meta_box['id'], $mfn_post_meta_box['title'], 'mfn_post_show_box', $mfn_post_meta_box['page'], $mfn_post_meta_box['context'], $mfn_post_meta_box['priority']); 
}

TO 
function mfn_post_meta_add() { 
global $mfn_post_meta_box; 
add_meta_box($mfn_post_meta_box['id'], $mfn_post_meta_box['title'], 'mfn_post_show_box', $mfn_post_meta_box['page'], $mfn_post_meta_box['context'], $mfn_post_meta_box['priority']); 
add_meta_box($mfn_post_meta_box['id'], $mfn_post_meta_box['title'], 'mfn_post_show_box', 'recipe', $mfn_post_meta_box['context'], $mfn_post_meta_box['priority']); 
}


 includes/content-single.php file on line 17 and change from:

if( ! mfn_post_thumbnail( get_the_ID() ) ) $classes[] = 'no-img';

to:

if( ! mfn_post_thumbnail( get_the_ID() ) || get_post_type( get_the_ID() ) == 'recipe' ) $classes[] = 'no-img';


is there anything else i should do to make this work? 


Comments

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.