Archived

This topic is now archived and is closed to further replies.

  • 0

Mutiple Custom Post Type Page Templates


Question

Posted · Report post

hi there,

 

Every time i try to enter a third custom post type, the page option setup screen fails to save the options for the last custom post type. I'm not a php person, but this is the code thats worked the best so far, i have a feeling that im defining the variables wrongly. Could you point me in the right direction?

 

Thanks!


// PageLines: Add Custom Post Type (CPT) to Page Options
add_filter( 'postsmeta_settings_array', 'pl_control_cpt' );
function pl_control_cpt( $array ) {
//1st one
$cpt = 'event'; //EDIT THIS FOR YOUR CUSTOM POST TYPE NAME
global $metapanel_options;
$array[ $cpt ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt ),
);
$array[ $cpt . '_archive' ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt . '_archive' ),
);

$cpt = 'night'; //EDIT THIS FOR YOUR CUSTOM POST TYPE NAME
global $metapanel_options;
$array[ $cpt ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt ),
);
$array[ $cpt . '_archive' ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt . '_archive' ),
);

$cpt = 'artist'; //EDIT THIS FOR YOUR CUSTOM POST TYPE NAME
global $metapanel_options;
$array[ $cpt ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt ),
);
$array[ $cpt . '_archive' ] = array(
'metapanel' => $metapanel_options->posts_metapanel( $cpt . '_archive' ),
);

return $array;
}

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

Unfortunately the moderating team are unable to assist with php solutions directly. We will leave this thread open however, if Martin is able to get a response from one of our developer team and advise directly they'll post here for you. Otherwise maybe another member of the developer group can provide further assistance on this for you.

Share this post


Link to post
Share on other sites

Posted · Report post

Looking into this for you 

Share this post


Link to post
Share on other sites

Posted · Report post

cheers :)

Share this post


Link to post
Share on other sites