• Resolved ORTB0261

    (@ortb0261)


    I’m trying to insert a flag icon in the social icons in order to link to my page in Spanish. I’ve use the snippet (http://presscustomizr.com/snippet/adding-custom-social-profile-link-icon-header/) like in Example 2, but in my function.php file I write:
    <a class="social-icon custom-icon" href="http://ortizbotellaabogados.es" title="Spanish" target="_blank"></a>
    And in the custom CSS section:

    .custom-icon:before {
    	content: "";
    	width: 20px;
    	height: 15px;
    	display: inline-block;
    	background: url('http://ortizbotellaabogados.es/eng/wp-content/uploads/sites/6/2016/03/Spain.png') no-repeat;
    	background-size: 18px 18px;
    }

    In the customizr preview it looks fine, but when I save it, the image doesn’t appear in the web, although the link is, but on “white”.
    When I go to the custom CSS again, the code have changed and appears:

    .custom-icon:before {
    	content: \"\";
    	width: 20px;
    	height: 15px;
    	display: inline-block;
    	background: url(\'http://ortizbotellaabogados.es/eng/wp-content/uploads/sites/6/2016/03/Spain.png\') no-repeat;
    	background-size: 18px 18px;
    }

    As you see, it has change the content line with two \ and the url with a | before and other at the end.
    Provisionally, I have placed the flag as part of the menu, but I want it to appear next to the Linkedin icon.
    The link is: http://ortizbotellaabogados.es/eng/
    Thank you (and I apologize if my English is not quite correct).

Viewing 6 replies - 1 through 6 (of 6 total)
  • Menaka S.

    (@menakas)

    Hi,
    The backslashes (\) are escape characters and it is not a problem. I can see the flag on your site.
    As you said, the flag is on the menu. You can add it to the social links by following the snippet.

    Thread Starter ORTB0261

    (@ortb0261)

    Hi.
    Now I’ve removed the flag from the menu, and in the site, near the Linkedin icon, there’s the “space” and even when you pass the mouse cursor over it, there’re the link and the “Alt” text (Spanish) but not the flag. Do I have to change any element of the snippet?
    I’ve read in the forum that someone had to change the expression custom-icon for newsletter-icon. Should I do something like that?
    Also I’m not using, not an icon of a social network, but an image from my “Media” folder .
    Thanks

    Menaka S.

    (@menakas)

    Hi,
    Try putting the custom CSS in child theme’s style.css

    Thread Starter ORTB0261

    (@ortb0261)

    Thanks. It works fine now.

    Thread Starter ORTB0261

    (@ortb0261)

    Hi.
    I put the custom CSS in child theme’s style.css, but the flag only is seen on the home page and not in the other pages.

    Thread Starter ORTB0261

    (@ortb0261)

    Hi again.
    At last I have my website in Spanish and English, but while in the English version the flag of Spain appears to link to the spanish version, in the Spanish version the flag with the link to the English version doesn’t appear.
    I’ve put the same custom CSS in child theme’s style.css (with the only change of the flag, obviously).
    And, as I put 1 month ago, in teh English site the flag only is seen on the home page and not in the other pages.
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add my own icon on header’ is closed to new replies.