• Resolved Avantart

    (@avantart)


    Hello again!

    I have some questions in relation to “Social Networks Icons”:

    I understand that the networks are defined in the parent’s function.php and they are output in header.php using the function
    ‘ct_apex_social_icons_output(‘header’);’

    1)
    I try to add Ravelry to the social icons.
    I am working with a child theme.
    If I add “ravelry” in parent’s function.php, this is listed in customizer

    If I add

    if(function_exists('ct_apex_social_array') ) {
    $social_sites['ravelry']='apex_ravelry_profile';
    }

    in functions.php of my child-theme, no result.
    But I do not want to edit the function.php of the parent theme in order to set $social_sites global

    2)
    Where to get the icon of the new network?
    where will “apex_ravelry_profile’ be defined?
    I now see that the icons come from Font Awesome, but what if an icon is not included there? Ravelry icon is not included

    Even when I ask to add this to the font, I am wondering how long it will take to include it

    Thanks in advance,

    Connie

Viewing 11 replies - 1 through 11 (of 11 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hey Connie,

    I need to add a function_exists() check to ct_apex_social_array() in the parent’s functions.php file to make this easier. Adding it to the child theme won’t work since the function will indeed already exist. Child theme code always runs after parent theme code.

    The ct_apex_social_icons_output() function is overridable, so you can copy that into your child theme. Then, create a new array with all of the existing social sites plus ravelry (this is where you add ‘apex_ravelry_profile’). Once that’s done, you can use that array instead of ct_apex_social_array() when setting the $social_sites variable at the beginning of ct_apex_social_icons_output().

    As for the actual icon, an image with a similar aesthetic will need to be used. Font Awesome is great, but unfortunately they move very slowly when it comes to new icons.

    Thread Starter Avantart

    (@avantart)

    Thanks, Ben,

    I will try that approach.

    I pushed the ravelry masters to support my request as well, so let us see

    for a fast solution I will have to write a special condition to add a ravelry icon, I feared that already :=)

    Cheers Connie

    Theme Author Ben Sibley

    (@bensibley)

    Yes, I’m afraid so, but that shouldn’t be too tough. You can copy the condition used for the ’email’ icon as a template for the ravelry conditional statement.

    Thread Starter Avantart

    (@avantart)

    well, I managed it, but I am not absolute happy with it, as this solution does not allow to enter the new URL in the customizer ;=)

    1) the code in the function.php of the child-theme

    a) the new array:
    $social_sites = add_apex_social_array();

    b) the output

    <?php } elseif ( $active_site == 'ravelry' ) {	?>
    <li><a class="fa-ravelry" target="_blank" href="Link to ravelry">&nbsp;</a></li>

    I had to create custom css with a hardcoded URl of the image:

    .fa-ravelry:before{
    content:url(https://www.domainname.com/wp-content/themes/apex-child/images/ravelry.png);}

    and as the output is not a letter in a font, I had to use a Link with a Blank as content: &nbsp;

    I would rather love to merge two arrays (the array of the parent funtion.php + the array with the new values) than to copy the array from parent to child

    Thread Starter Avantart

    (@avantart)

    I forgot to mark as resolved

    Theme Author Ben Sibley

    (@bensibley)

    Understood, nice work with the new icon.

    In the next update I will add a function_exists() check to the array, and also a filter before it returns its value. With the filter, you will be able to add a function to your child theme that simply appends the ‘ravelry’ value to the end of the array. Then it will automatically be included in the Customizer as well.

    Thread Starter Avantart

    (@avantart)

    That is great to hear!

    have a nice day,

    Connie

    Thread Starter Avantart

    (@avantart)

    Unfortunately, the solution is not 100% ok

    I made a fresh install and still the situation is that I see the social icons in the customizer preview, but they are not visible in the “real world”

    have a check here:
    https://www.urbanistan.de/WordWock/2015/08/14/beitrag-mit-featured-image/

    Theme Author Ben Sibley

    (@bensibley)

    I just visited and I’m seeing the icons now: https://pics.competethemes.com/image/2B1O2n301V17

    Perhaps it was a caching issue?

    Thread Starter Avantart

    (@avantart)

    Oh, I am so stupid, it is the “ADD Block Plus” extension in firefox… when deactivated, I see the icons….

    here you see how far you can go when you don’t want any Facebook-related items at your page ;=)

    Yes, it is working….

    have a nice weekend!

    Connie

    Theme Author Ben Sibley

    (@bensibley)

    Haha you too ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Adding additional social network’ is closed to new replies.