-
AuthorPosts
-
August 7, 2014 at 11:39 am #301034
Hello,
I am no expert in coding but am curious so I have tried to sort the first part of the issue (moving the search button in the secondary menu) by following the advice in this topic from late 2013 – https://kriesi.at/support/topic/move-search-icon-to-secondary-menu/ – unfortunately I could not find the code bits referred in there in the header .php file :(
Could you please help? And also let me know if there is a similar way in inserting a widget area created with Enfold in the same menu bar?
Many many thanks for your help, it would be great to solve this as I have reached the maximum of my abilities here!
Best!
August 9, 2014 at 5:27 am #301918Hey!
Try adding this at the very end of your theme functions.php file:
add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 ); add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 10, 2 ); function avia_append_search_nav ( $items, $args ) { if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items; if ((is_object($args) && $args->theme_location == 'avia2') || (is_string($args) && $args = "fallback_menu")) { global $avia_config; ob_start(); get_search_form(); $form = htmlspecialchars(ob_get_clean()) ; $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown"> <a href="?s=" rel="nofollow" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'><span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span></a> </li>'; } return $items; }
Cheers!
JosueAugust 9, 2014 at 2:05 pm #302000Hey Josue and thank you very much for looking into this, I have added the code at the end of theme functions.php as you said but it seems to have blocked the entire wp admin interface, something must have gone wrong. Please help!
Cerasel
August 9, 2014 at 7:42 pm #302051Hi,
Try this method instead, open functions-enfold.php and look for line 63:
if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu"))
Replace it by this:
if ((is_object($args) && $args->theme_location == 'avia2') || (is_string($args) && $args = "fallback_menu"))
Regards,
JosueAugust 9, 2014 at 10:51 pm #302078This reply has been marked as private.August 9, 2014 at 10:56 pm #302080Hi,
I can try but i’d need FTP access, can you please create me an temporary FTP account? post it here as a private reply.
Regards,
JosueAugust 9, 2014 at 11:14 pm #302082This reply has been marked as private.August 9, 2014 at 11:20 pm #302083Ok, let me know :)
August 11, 2014 at 2:45 pm #302628This reply has been marked as private.August 11, 2014 at 8:20 pm #302844Hi!
Change this line:
if ((is_object($args) && $args->theme_location == ‘avia’) || (is_string($args) && $args = “fallback_menu”))
To:
if ((is_object($args) && $args->theme_location == ‘avia2’) || (is_string($args) && $args = “fallback_menu”))
Best regards,
JosueAugust 11, 2014 at 11:05 pm #302897Hi Josue,
Thank you, the second code worked!
Could you please send me an equivalent one for the (Enfold custom) widget area?
Best regards,
Cerasela
August 11, 2014 at 11:13 pm #302905Hey Cerasela!
You can use the “Search” widget for that.
Cheers!
JosueAugust 12, 2014 at 12:58 am #302919This reply has been marked as private.August 13, 2014 at 3:47 am #303570Hey!
I see the search element in the upper bar. I didn’t understand exactly what you want to achieve, can you post a screenshot/mockup?
Best regards,
JosueAugust 13, 2014 at 10:39 am #303700This reply has been marked as private.August 15, 2014 at 4:48 am #304697Hi,
1. Open /includes/helper-main-menu.php and look for line 68:
if($phone) { echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>"; }
2. Replace it by this:
if($phone) { echo "<div class='phone-info {$phone_class}'><span>".do_shortcode($phone)."</span></div>"; }
3. Then install this plugin: Widget Shortcode.
4. Go to Appareance > Widgets and look for the qTranslate specific shortcode:
5. Finally paste the shortcode here:
Regards,
JosueAugust 15, 2014 at 12:14 pm #304857This reply has been marked as private.August 15, 2014 at 7:08 pm #305041Hey Cerasela!
I’m seeing the switcher on all pages, try refreshing a few items. I think it needs some CSS adjustments though, add this:
.phone-info select { margin: 0 !important; } .phone-info .widget_qtranslate { padding: 0 !important; }
Best regards,
JosueAugust 16, 2014 at 12:50 pm #305277This reply has been marked as private.August 16, 2014 at 6:37 pm #305331Hey Cerasela!
Sorry for not explaining, add it to Quick CSS (Enfold > General Styling).
Regards,
JosueAugust 17, 2014 at 12:41 pm #305422Thank you very much Josue, it looks good now!
Best,
Cerasela
August 17, 2014 at 4:45 pm #305438Hi Josue, this trick is interested. How do I set this (if possible) in my child theme?
August 17, 2014 at 6:33 pm #305452Hi @czar!
Try copying the modified /includes/helper-main-menu.php to your child theme folder.
Best regards,
JosueAugust 17, 2014 at 7:42 pm #305470Great Josue, many thanks but another courtesy: which use shortcode or php code to display breadcrumb? thanks
August 17, 2014 at 8:12 pm #305483Hi!
There is no shortcode to display the breadcrumb trail, if you want that you’d need to call the avia_breadcrumbs() function in the helper-main-menu.php file, change this line:
if($phone) { echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>"; }
To:
echo "<div class='phone-info {$phone_class}'>".avia_breadcrumbs()."</div>";
Best regards,
JosueAugust 17, 2014 at 9:52 pm #305499Ok, many tanks Josue
August 17, 2014 at 10:18 pm #305503You are welcome, always glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Insert search button and widget area in the secondary menu bar’ is closed to new replies.