Viewing 12 posts - 31 through 42 (of 42 total)
  • Author
    Posts
  • #1046269

    please post your whole child-theme functions.php again

    #1046271

    first of all : on your code here there is the closing a – tag missing: https://kriesi.at/support/topic/how-to-insert-search-form-into-header_posline-next-to-phone-number/#post-1046245

    #1046272

    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);
    #1046273
    #1046276

    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');
    #1046278

    so sorry now – here stops my support.
    i see there is on phone-info field always that shortcode inserted thing. Maybe this is from the do_php_shortcode_fix in your functions.php.
    i guess you have to wait here for mods to login to your developement site to see what is the thing. On my test page it works this way – so there must be some inconsitencies. Sorry – i have to do my work now.

    #1046279

    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.

    #1046749

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

    #1046825

    You may open a new thread with the hint ( link ) to this started topic here.. Here really one of the moderators with admin access has to look into your developer installation.
    You have also installed Uber-Menu and this shortcodefix is still haunting you. So everything else than Enfold Standard installation. I would only recommend you to update to the latest Enfold 4.5.1 version.

    Actually, I always get my help through to the solution. But in this case someone has to log in to really create order.

    #1047598

    Hi,

    Thanks @guenni007!

    I checked the site but all I see is a blank page with red background. Please provide the new link or post the login details in the private field.

    Best regards,
    Ismael

    #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 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

    #1071146

    Hi,

    Thanks for sharing. I’m sure it will help a lot of users. We’ll close this thread now.

    Best regards,
    Ismael

Viewing 12 posts - 31 through 42 (of 42 total)
  • The topic ‘How to insert search form into header_posline next to phone number?’ is closed to new replies.