WordPress.org

Ready to get started?Download WordPress

Forums

Yoko
[resolved] removing social media widget text (7 posts)

  1. robert.m.lovitt
    Member
    Posted 2 years ago #

    I am interesting in removing the text that shows up next to my social buttons in the yoko social media widget. Is this possible? I believe I have to modify the functions.php doc, but would like some input before doing so. Thanks!

    http://wordpress.org/extend/themes/yoko/

  2. Marventus
    Member
    Posted 2 years ago #

    Hi there.

    I believe I have to modify the functions.php

    That is correct, yes, particularly, lines 470 to 477. You have to modify the conditional statements that are testing whether or not the icon text is empty, and instead test whether the social icon url is empty.
    Example:
    The code for your RSS icon should change from this:

    if($rss_title == ' ') { echo ''; } else {  echo  '<li class="widget_sociallinks"><a href="'. $rss_url .'" class="rss" target="_blank">'. $rss_title .'</a></li>'; }

    To this:

    if($rss_url == ' ') { echo ''; } else {  echo  '<li class="widget_sociallinks"><a href="'. $rss_url .'" class="rss" target="_blank"></a></li>'; }

    Then, you have two choices:
    1. Style the <a> and <li> tags through CSS and leave the links empty;
    2.Modify the HTML output further so as to change your HTML structure from this:

    <ul>
       <li>
          <a>Icon 1 Text
          </a>
       </li>
       <li>
          <a>Icon 2 Text
          </a>
       </li>
       Etc.
    </ul>

    To this:

    <ul>
       <li>
          <a>
             <img src="path/to/icon/1" />
          </a>
       </li>
       <li>
          <a>
             <img src="path/to/icon/2" />
          </a>
       </li>
       Etc.
    </ul>

    In the second case, you would need to remove background images to your links and either:
    1. Hardcode the entire image path in the src img attributes;
    2. Hardcode part of it and leave the image name dynamic. For instance, you could use the icon text option as the image file name, like so:

    if($rss_url == ' ') { echo  '<li class="widget_sociallinks"><a href="'. $rss_url .'" class="rss" target="_blank"><img src="/path/to/icons/folder/'. $rss_title .'.png alt="'. $rss_title .'" /></a></li>'; }

    Cheers!

  3. robert.m.lovitt
    Member
    Posted 2 years ago #

    Brilliant! Thanks for your help!

  4. Marventus
    Member
    Posted 2 years ago #

    No problem. I hope you can figure it out.
    Cheers!

  5. Marventus
    Member
    Posted 2 years ago #

    Hi there.
    If the above code worked and you were able to figure out your issue, could you please mark the thread as resolved whenever you get a chance?
    Thanks!

  6. robert.m.lovitt
    Member
    Posted 2 years ago #

    Will do. Thanks again!

  7. Odellcom
    Member
    Posted 1 year ago #

    can you do it through a menu? I'm no coder. I added them somehow but can't see where I can hide them or remove them.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags