Forum Replies Created

Viewing 30 posts - 1 through 30 (of 32 total)
  • Author
    Posts
  • 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 file

    The 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

    i 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 :(

    That’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.

    Are 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');

    I 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>&nbsp;&nbsp;';
            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);

    yeah, thats using your ‘method #2’

    and the second search icon is displayed only when I insert
    &nbsp;&nbsp; in your $items variable block

    Here 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>&nbsp;&nbsp;';
            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);

    Oddly, if I comment out your code (even after leaving in the modified css for the other search icon) both search icons now disappear.

    Doesn’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!! :(

    The 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>&nbsp;&nbsp;';
            echo $items;
    }
    
    function custom_shift(){
    ?>
    <script>
    (function($){
            $('#header_meta #menu-item-search').prependTo('#avia2-menu');
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_shift');
    This reply has been marked as private.

    Here 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>&nbsp;&nbsp;';
            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?

    Ok 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?

    Ok, 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.

    I’ve created a dev copy of this site and still can’t get any of these options to work :(

    I’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.

    Here 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>&nbsp;&nbsp;&nbsp;';
      }
    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);
        

    Hi 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.

    I’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?

    You 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!

    I 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.

    Hi Support,

    Any chance / luck with this? I’m still having no success.

    Success 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!

    This reply has been marked as private.
    in reply to: Avia Layout Builder – Blog Post – Pagination not working #1005216

    I’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?

    Updating 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?

    oh 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.

    I just tested these and they work.

    • This reply was modified 6 years, 2 months ago by Rikard.

    I 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

    in reply to: How to Add Search Bar to Logo Area #976032

    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;
    }

    in reply to: How to Add Search Bar to Logo Area #976019

    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.

Viewing 30 posts - 1 through 30 (of 32 total)