Forum Replies Created
-
AuthorPosts
-
February 22, 2019 at 1:29 pm in reply to: How to insert search form into header_posline next to phone number? #1070309
Apologies for the lack of updates here, the end resolution for me was to hire a web developer with more experience than me.
They went through and recoded / overwrote a bunch of css to fix the issue. Combined with modifications in the child theme helper-main-menu.php fileThe main changes were done in Appearance -> Customize CSS to override the themes css
.header-searchform { display: inline-block; padding-right: 1em; text-align:left; } .header-searchform .ajax_search_response { background-color:#fff; position:absolute !important; } .menu-item-search { display:none; } #header_meta { text-align:right; } .custom-header-buttons { width:100%; display:flex; justify-content:space-between; } #header_posline { width:100%; margin-right:0px; display:block !important; margin-top:10px; z-index:9999; } @media screen and (min-width:992px){ #header_posline { width:calc(100% - 230px); max-width:737px; margin: 0 auto; right: 45px; position:absolute; top:-12px; } .header-button { height:55px; } } .header-button a { display:block; height:45px; }
Hopefully this may help someone, I kept forgetting to come back here and I hate finding tickets that are open without a resolution
December 18, 2018 at 8:22 am in reply to: How to insert search form into header_posline next to phone number? #1046749i cannot work out why this search icon’s are not being displayed now, I’ve reverted it all back to what should be standard and no search icons :(
December 17, 2018 at 12:43 pm in reply to: How to insert search form into header_posline next to phone number? #1046279That’s more than fine, thank you for your assistance, almost seems like it is worth me to break the code and remove that closing so it appears again, thank you!
Hopefully the devs check this ticket soon too.
December 17, 2018 at 12:31 pm in reply to: How to insert search form into header_posline next to phone number? #1046276Are you are correct, my mistake there when retyping it.
Now that I’ve inserted the both search items vanished.add_filter( 'avf_execute_avia_meta_header', '__return_true', 10, 1); add_filter( 'avia_meta_header', 'avia_append_search_nav_mod'); function avia_append_search_nav_mod(){ 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 menu-item-avia-special"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'> <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span> </a> </li>'; echo $items; } function custom_shift(){ ?> <script> (function($){ // $('#header_meta #menu-item-search').prependTo('#avia2-menu'); $('#header_meta #menu-item-search').prependTo('#header_meta .sub_menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift');
December 17, 2018 at 12:23 pm in reply to: How to insert search form into header_posline next to phone number? #1046272I just did in the last post, but here it is again.
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { dynamic_sidebar( 'header' ); } add_filter("kriesi_backlink","new_link"); function new_link(){ $kriesi_at_backlink = ""; return $kriesi_at_backlink; } add_filter( 'avf_execute_avia_meta_header', '__return_true', 10, 1); add_filter( 'avia_meta_header', 'avia_append_search_nav_mod'); function avia_append_search_nav_mod(){ 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 menu-item-avia-special"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'> <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span> </li> '; echo $items; } function custom_shift(){ ?> <script> (function($){ // $('#header_meta #menu-item-search').prependTo('#avia2-menu'); $('#header_meta #menu-item-search').prependTo('#header_meta .sub_menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift'); /* Create shortcode for parent page. */ function list_parent_page() { global $post; $parent_id = $post->post_parent; $parent = $post->post_parent; $parent_title = get_the_title($parent); $link = get_permalink($parent_id); $parent_title = "<a href='$link' title='$parent_title'>$parent_title</a>"; if($parent) { return $parent_title; } } function list_current_page() { get_the_title(); } add_shortcode('parentpage','list_parent_page'); add_filter( 'widget_title', 'do_shortcode' ); // fix for PHP shortcode function do_php_shortcode_fix($content) { global $shortcode_tags; // save current shortcodes $old_shortcode_tags = $shortcode_tags; // remove all shortcodes, then re-add just our php and echo shortcodes remove_all_shortcodes(); add_shortcode('php', $old_shortcode_tags['php']); add_shortcode('echo', $old_shortcode_tags['echo']); $content = do_shortcode($content); // and now put back the original shortcodes $shortcode_tags = $old_shortcode_tags; return $content; } function fix_php_shortcode_init() { global $shortcode_tags; if (isset($shortcode_tags['php'])) { // Move do_shortcode back to default of priority 11 if(remove_filter('the_content','do_shortcode', 9)) add_filter('the_content','do_shortcode', 11); // filter the content to deal with just the php and echo shortcodes // early on as priority 8 (before any WP formatting) add_filter('the_content', 'do_php_shortcode_fix', 8); } } // add fix for PHP shortcode, with priority 12 so it // comes after the PHP shortcode has been initialised add_action('init','fix_php_shortcode_init', 12);
December 17, 2018 at 12:16 pm in reply to: How to insert search form into header_posline next to phone number? #1046267yeah, thats using your ‘method #2’
and the second search icon is displayed only when I insert
in your $items variable blockHere is the current functions.php
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { dynamic_sidebar( 'header' ); } add_filter("kriesi_backlink","new_link"); function new_link(){ $kriesi_at_backlink = ""; return $kriesi_at_backlink; } add_filter( 'avf_execute_avia_meta_header', '__return_true', 10, 1); add_filter( 'avia_meta_header', 'avia_append_search_nav_mod'); function avia_append_search_nav_mod(){ 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 menu-item-avia-special"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'> <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span> </li> '; echo $items; } function custom_shift(){ ?> <script> (function($){ // $('#header_meta #menu-item-search').prependTo('#avia2-menu'); $('#header_meta #menu-item-search').prependTo('#header_meta .sub_menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift'); /* Create shortcode for parent page. */ function list_parent_page() { global $post; $parent_id = $post->post_parent; $parent = $post->post_parent; $parent_title = get_the_title($parent); $link = get_permalink($parent_id); $parent_title = "<a href='$link' title='$parent_title'>$parent_title</a>"; if($parent) { return $parent_title; } } function list_current_page() { get_the_title(); } add_shortcode('parentpage','list_parent_page'); add_filter( 'widget_title', 'do_shortcode' ); // fix for PHP shortcode function do_php_shortcode_fix($content) { global $shortcode_tags; // save current shortcodes $old_shortcode_tags = $shortcode_tags; // remove all shortcodes, then re-add just our php and echo shortcodes remove_all_shortcodes(); add_shortcode('php', $old_shortcode_tags['php']); add_shortcode('echo', $old_shortcode_tags['echo']); $content = do_shortcode($content); // and now put back the original shortcodes $shortcode_tags = $old_shortcode_tags; return $content; } function fix_php_shortcode_init() { global $shortcode_tags; if (isset($shortcode_tags['php'])) { // Move do_shortcode back to default of priority 11 if(remove_filter('the_content','do_shortcode', 9)) add_filter('the_content','do_shortcode', 11); // filter the content to deal with just the php and echo shortcodes // early on as priority 8 (before any WP formatting) add_filter('the_content', 'do_php_shortcode_fix', 8); } } // add fix for PHP shortcode, with priority 12 so it // comes after the PHP shortcode has been initialised add_action('init','fix_php_shortcode_init', 12);
December 17, 2018 at 12:11 pm in reply to: How to insert search form into header_posline next to phone number? #1046265Oddly, if I comment out your code (even after leaving in the modified css for the other search icon) both search icons now disappear.
December 17, 2018 at 12:08 pm in reply to: How to insert search form into header_posline next to phone number? #1046262Doesn’t seem like anything changes if I modify that header_meta line.
I’m going to go try style that small one now per your instructions, I must say thank you so much for your assistance with this, has been remarkable.
As for 4.4.1 I swear we only upgraded to that like last month or maybe 1-2months ago!! :(December 17, 2018 at 11:34 am in reply to: How to insert search form into header_posline next to phone number? #1046245The one from the screenshot is using the method where the phone number wasn’t included and without the [search].
The only time that second search icon appeared, was when I tried to put a space between the search icon in front of the phone number, i put 2 x nbsp and then it suddenly appeared.add_filter( 'avf_execute_avia_meta_header', '__return_true', 10, 1); add_filter( 'avia_meta_header', 'avia_append_search_nav_mod'); function avia_append_search_nav_mod(){ 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 menu-item-avia-special"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'> <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span> </li> '; echo $items; } function custom_shift(){ ?> <script> (function($){ $('#header_meta #menu-item-search').prependTo('#avia2-menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift');
December 17, 2018 at 11:33 am in reply to: How to insert search form into header_posline next to phone number? #1046244This reply has been marked as private.December 17, 2018 at 9:37 am in reply to: How to insert search form into header_posline next to phone number? #1046203Here is something interesting, I think I can work with just the search symbol there possibly (depending on the client request)
However I tried to put a space between the search icon and the phone icon.Then another search icon appeared in the header, you can see it in this screenshot , its small and orange, it behaves exactly the same as well, but seems to have been hidden.
code used
add_filter( 'avf_execute_avia_meta_header', '__return_true', 10, 1); add_filter( 'avia_meta_header', 'avia_append_search_nav_mod'); function avia_append_search_nav_mod(){ 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 menu-item-avia-special"> <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'> <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span> </li> '; echo $items; } function custom_shift(){ ?> <script> (function($){ $('#header_meta #menu-item-search').prependTo('#avia2-menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift');
Any idea where that other search icon came from? should we be using that one somehow?
December 17, 2018 at 9:25 am in reply to: How to insert search form into header_posline next to phone number? #1046201Ok more success with your other methods, seems the problem was when I was copy/pasting the code from the forum into vim, there were some character issues.
Retyping the whole part, now brings up the search icon, is there a way to actually retain the search form input box in the header though, rather than all methods where you click on the search glass icon, and it pops up the search form?
December 17, 2018 at 9:14 am in reply to: How to insert search form into header_posline next to phone number? #1046198Ok, I just got your first method working, the problem was a custom ‘helper-main-menu.php’ in the child theme /include directory.
I updated that with the latest version from the parent theme and then attempted your first method with the [search] in the phone field and sure enough the search icon was displayed and when clicked will popup a little search form. I agree this is not a clean method.
I then happy that worked, went to try your second method and unfortunately nothing showed up in that search spot, will see if I can spot any reason why thats not working.
December 17, 2018 at 8:46 am in reply to: How to insert search form into header_posline next to phone number? #1046194I’ve created a dev copy of this site and still can’t get any of these options to work :(
December 16, 2018 at 10:13 pm in reply to: How to insert search form into header_posline next to phone number? #1046074I’m not sure why the fix for phpshortcode is there. I have inherited this site to fix / make modifications for a client after their developer vanished.
So I keep finding wierd items, I still can’t get these search items to show, there must be some additional custom css or other code thats conflicting with it. I’ll keep trying, thank you fro yoru help so far, very much appreciated.
Almost wondering if I just try shift the search form with css up into the navbar section if I can’t get one of these modifications working.
December 16, 2018 at 1:39 pm in reply to: How to insert search form into header_posline next to phone number? #1045891Here is my child functions.php modification for your first method, just to see if we can get something working.
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ #add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function search() { global $avia_config; ob_start(); get_search_form(); $form = htmlspecialchars(ob_get_clean()) ; return '<a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'><span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span></a> '; } add_shortcode('search', 'search'); function enfold_customization_header_widget_area() { dynamic_sidebar( 'header' ); } add_filter("kriesi_backlink","new_link"); function new_link(){ $kriesi_at_backlink = ""; return $kriesi_at_backlink; } function custom_shift(){ ?> <script> (function($){ $('#header_meta #menu-item-search').prependTo('#avia2-menu'); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_shift'); /* Create shortcode for parent page. */ function list_parent_page() { global $post; $parent_id = $post->post_parent; $parent = $post->post_parent; $parent_title = get_the_title($parent); $link = get_permalink($parent_id); $parent_title = "<a href='$link' title='$parent_title'>$parent_title</a>"; if($parent) { return $parent_title; } } function list_current_page() { get_the_title(); } add_shortcode('parentpage','list_parent_page'); add_filter( 'widget_title', 'do_shortcode' ); // fix for PHP shortcode function do_php_shortcode_fix($content) { global $shortcode_tags; // save current shortcodes $old_shortcode_tags = $shortcode_tags; // remove all shortcodes, then re-add just our php and echo shortcodes remove_all_shortcodes(); add_shortcode('php', $old_shortcode_tags['php']); add_shortcode('echo', $old_shortcode_tags['echo']); $content = do_shortcode($content); // and now put back the original shortcodes $shortcode_tags = $old_shortcode_tags; return $content; } function fix_php_shortcode_init() { global $shortcode_tags; if (isset($shortcode_tags['php'])) { // Move do_shortcode back to default of priority 11 if(remove_filter('the_content','do_shortcode', 9)) add_filter('the_content','do_shortcode', 11); // filter the content to deal with just the php and echo shortcodes // early on as priority 8 (before any WP formatting) add_filter('the_content', 'do_php_shortcode_fix', 8); } } // add fix for PHP shortcode, with priority 12 so it // comes after the PHP shortcode has been initialised add_action('init','fix_php_shortcode_init', 12);
December 16, 2018 at 1:03 pm in reply to: How to insert search form into header_posline next to phone number? #1045881Hi Guenni007, I’ve provided the url in private content now. I’m going to try method 1 again , like yous aid thats the simpliest, surely I can’t be stuffing up inserting some code into child functions.php and then adding [search] to an input box.
December 15, 2018 at 11:21 am in reply to: How to insert search form into header_posline next to phone number? #1045620I’m not having any success with any of these items, I must be doing something wrong.
I attempted each method, method #1 with the function in the child theme fucntions.php and putting the [search] into the phone field, displayed [search] on the actual website.
then I tried the second method, added code to child field , nothing in the phone field and nothing was displayed in the nav bar section.
Same with the third option.Do I need to do any other modifications other than add those code segments to the child functions.php file?
September 11, 2018 at 7:58 am in reply to: Parent theme upgraded to 4.4.1 – site has lost all styles/layouts after update #1008226You are 100% correct, I have tabs open still showing all the styles missing, its like it must of been a cache problem.
I haven’t viewed the site in 3-4 days since submitting this ticket. I have no explanation! It is working as you said!
September 11, 2018 at 7:43 am in reply to: Parent theme upgraded to 4.4.1 – site has lost all styles/layouts after update #1008218I didnt transfer anything, I was simply ‘upgrading the theme’
All I did was upgrade the theme by updating the parent theme and then the site lost all styles/layout etc.
September 11, 2018 at 3:54 am in reply to: Parent theme upgraded to 4.4.1 – site has lost all styles/layouts after update #1008152Hi Support,
Any chance / luck with this? I’m still having no success.
September 4, 2018 at 7:08 am in reply to: Avia Layout Builder – Blog Post – Pagination not working #1005302Success that seems to have done it!! I thought I tried that exact line but I must of mistyped it or had cache issues, the bar at the top is now hidden and the standard header is still displayed.
Excellent, thank you!
September 4, 2018 at 6:28 am in reply to: Avia Layout Builder – Blog Post – Pagination not working #1005286This reply has been marked as private.September 3, 2018 at 10:42 pm in reply to: Avia Layout Builder – Blog Post – Pagination not working #1005216I’ve done that and now its destroyed the header on the site, seems the previous dev put a lot of custom elements in it.
Surely its easier to simply hide 2 elements instead of having to rebuild the entire header?
September 3, 2018 at 2:39 pm in reply to: Avia Layout Builder – Blog Post – Pagination not working #1004983Updating the theme has seemed to fix those issues, except I cannot deploy the changes as there is now this ‘advance_menu_toggle’ and ‘advanced_menu_hide’ that is being displayed in the header and I can’t hide it.
Any way to hide this after the parent theme update?
August 26, 2018 at 10:49 pm in reply to: Avia Layout Builder – Blog Post – Pagination not working #1002035oh did I not provide the link?!? my mistake, I have a dev site setup of the main site I am testing it on
- This reply was modified 6 years, 2 months ago by Rikard.
August 26, 2018 at 2:15 pm in reply to: Avia Layout Builder – Blog Post – Pagination not working #1001874I just tested these and they work.
- This reply was modified 6 years, 2 months ago by Rikard.
August 26, 2018 at 9:23 am in reply to: Avia Layout Builder – Blog Post – Pagination not working #1001829I should mention, I have tested with the parent theme – still fails
removed the child functions.php – still fails
The exact same behaviour, the same posts show up on page2 as page1
Hi Victoria (and anyone following my query in this thread)
I was able to resolve the issue of the nav_header being on top of the search widget in the header by modifying the z-index of the .av_main_nav_header.av_menu_right
I couldn’t put this in the extra css portion within the theme settings, instead it had to go into the style.css in the child theme.
Once this was done, its working as desired.
.av_main_nav_header.av_menu_right #header_main .main_menu-uber {
clear: none;
position: absolute;
z-index: inherit;
line-height: 30px;
height: 100%;
margin: 0;
right: 50px;
}Hi Victoria,
Ahh so it is, I can’t increase the size of the header unfortunately as this is where they want the search bar, where it resides now is slightly different to your screenshot as it is aligned with the menu.
That said I thought changing the z-index of it would help, so it sits ‘on top’ but that doesn’t seem to be working or I’m doing it wrong.
-
AuthorPosts