New Landing How can we help? Cardinal Custom icon in header navigation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Posted in: Cardinal
  • #173701
    Tina Worthy
    Member
    Post count: 5

    Hi, I’d like to put a custom icon at the right hand end of the navigation list in my header. I’ve searched the forums and think that maybe you can’t do this through the theme options. Is there any way that we can do it? Can you write some custom code that allows us to? I’ve attached the draft icon that we might use. Thanks for any help. Tina

    Attachments:
    You must be logged in to view attached files.
    #173729
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Do you want to insert icon just after search icon?

    Thanks
    Mohammad

    #173733
    Tina Worthy
    Member
    Post count: 5

    Hi, yes I do, after the search icon please. We may need to change the icon periodically, can this be done too? Thanks.

    #173742
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of your child theme.

    function sf_get_search($type) {
    			
    			if ($type == "search-off") {
    				return;
    			}
    			
    			global $sf_options;
    			
    			$header_search_pt = $sf_options['header_search_pt'];
    			$ajax_url = admin_url('admin-ajax.php');
    			
    			$search_output = "";
    			
    			$search_output .= '<li class="menu-search parent"><a href="#" class="header-search-link-alt"><i class="ss-search"></i></a>'. "\n";
    			$search_output .= '<div class="ajax-search-wrap" data-ajaxurl="'.$ajax_url.'"><div class="ajax-loading"></div><form method="get" class="ajax-search-form" action="'.home_url().'/">';
    			if ($header_search_pt != "any") {
    			$search_output .= '<input type="hidden" name="post_type" value="'.$header_search_pt.'" />';
    			}
    			$search_output .= '<input type="text" placeholder="'.__("Search", "swiftframework").'" name="s" autocomplete="off" /></form><div class="ajax-search-results"></div></div>'. "\n";
    			$search_output .= '</li>'. "\n";	
    $search_output .= '<li><a href="#"><img src="src_url" alt="" /></a></li>'. "\n";	
    			
    			return $search_output;
    		}

    You need to change image src and link at end of line of this code.

    $search_output .= '<li><a href="#"><img src="src_url" alt="" /></a></li>'. "\n";

    #173744
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Can you provide a link and login so we can help you out with this

    – Kyle

    #173751
    Tina Worthy
    Member
    Post count: 5

    It works with your code. Thanks a lot for replying so quickly, we really appreciate it!

    #173760
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Great, thanks Mohammad

    – Kyle

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register