-
AuthorPosts
-
August 17, 2017 at 10:49 am #840325
on a thread here on board it happens maybe as an update fault or something else that on frontpage there was a different Headerstyle than on other pages.
So this is a starting point for me to look if it is possible to have f.e. on frontpage Header centered – Navigation below – and on other pages a different one.
The first idea from me was to create a select box on editor page to have the opportunity to switch.
Here we go: this is for functions.php of your child-themeadd_filter('avf_builder_boxes', 'register_meta_boxes', 10, 1); function register_meta_boxes($boxes) { $boxes[] = array( 'title' =>__('Header','avia_framework' ), 'id'=>'header', 'page'=>array('page' , 'post' , 'single-portfolio' ), 'context'=>'side', 'priority'=>'low'); return $boxes; } add_filter('avf_builder_elements', 'register_meta_elements', 10, 1); function register_meta_elements($avf_builder_elements) { $avf_builder_elements[] = array( "slug" => "header", "name" => __("Menu and Logo Position", 'avia_framework'), "desc" => __("You can choose various different logo and main menu positions here", 'avia_framework'), "id" => "header_layout", "type" => "select", "std" => "", "subtype" => array( __('Logo left, Menu right', 'avia_framework') =>'logo_left main_nav_header menu_right', __('Logo right, Menu Left', 'avia_framework') =>'logo_right main_nav_header menu_left', __('Logo left, Menu below', 'avia_framework') =>'logo_left bottom_nav_header menu_left', __('Logo right, Menu below', 'avia_framework') =>'logo_right bottom_nav_header menu_center', __('Logo center, Menu below', 'avia_framework') =>'logo_center bottom_nav_header menu_right', )); return $avf_builder_elements; }
don’t know if class and target are necessary here but i take it from sourcecode of register-admin-options.php
looks this way on editor side:
by the way i removed the last option ( Header centered – Menu on top):
__('Logo center, Menu above', 'avia_framework') =>'logo_center bottom_nav_header top_nav_header menu_center',
because it didn’t work imediately without doing something additional
August 20, 2017 at 1:59 pm #841661Hey Guenter,
Thanks for pointing this out. Though I would integrate it in the layout box.
I put it on the enhancement list for one of the next updates.
LG aus Wien
GünterAugust 26, 2017 at 6:59 pm #844387Yes this might be the best position for it:
add_filter('avf_builder_boxes', 'register_meta_boxes', 10, 1); function register_meta_boxes($boxes) { $boxes[] = array( 'title' =>__('Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('page' , 'post' , 'portfolio' ), 'context'=>'side', 'priority'=>'low'); return $boxes; } add_filter('avf_builder_elements', 'register_meta_elements', 10, 1); function register_meta_elements($avf_builder_elements) { $avf_builder_elements[] = array( "slug" => "layout", "name" => __("Menu and Logo Position", 'avia_framework'), "desc" => __("You can choose various different logo and main menu positions here", 'avia_framework'), "id" => "header_layout", "type" => "select", "std" => "", "subtype" => array( __('Logo left, Menu right', 'avia_framework') =>'logo_left main_nav_header menu_right', __('Logo right, Menu Left', 'avia_framework') =>'logo_right main_nav_header menu_left', __('Logo left, Menu below', 'avia_framework') =>'logo_left bottom_nav_header menu_left', __('Logo right, Menu below', 'avia_framework') =>'logo_right bottom_nav_header menu_center', __('Logo center, Menu below', 'avia_framework') =>'logo_center bottom_nav_header menu_right', )); return $avf_builder_elements; }
August 29, 2017 at 7:18 pm #845422 -
AuthorPosts
- You must be logged in to reply to this topic.