Add post type to ddi_functions.php
-
Do you still offer support? See that I’ve posted a year ago as well without response, hopefully this one will get a response..
I would like to add a custom post type (‘tour’ in this case), so that I can select the preferred menu on those pages as well. I’ve tried adding in to the ddi_functions.php file but keep getting 500 errors. Any help would be awesome.
So I’ve added this:
{
if($post->post_type==’page’ || $post->post_type==’post’){
$selected_menu_id = get_post_meta( $post->ID ,’selected_menu’);
$menus = wp_get_nav_menus();
}to this:
{
if($post->post_type==’page’) {
$selected_menu_id = get_post_meta( $post->ID ,’selected_menu’);
$menus = wp_get_nav_menus();
} elseif ($post->post_type==’post’) {
$selected_menu_id = get_post_meta( $post->ID ,’selected_menu’);
$menus = wp_get_nav_menus();
} else ($post->post_type==’tour’){
$selected_menu_id = get_post_meta( $post->ID ,’selected_menu’);
$menus = wp_get_nav_menus();
endif;
}note: errors in brackets might come from copying. Checked them carefully.
Hope you or someone accidentally passing by can help me ??
- The topic ‘Add post type to ddi_functions.php’ is closed to new replies.