Question

I am using a wordpress theme. I have configured it successfully, but when I try to place social icons, for instance, facebook on top, I need to change the title of the same from "Theme on facebook" to "click here to like". I tried to change the theme-options.php file under admin folder as well as header files, but to no success. Even I founded and replaced every title with "facebook", but it is still being showed as "Theme on facebook".

The below code under the file header-extensions.php is printing this code.

/****************************************************************************************/



if ( ! function_exists( 'theme_socialnetworks' ) ) :

/**

 * This function for social links display on header

 *

 * Get links through Theme Options

 */

function theme_socialnetworks( $flag ) {



    global $themee_theme_options_settings;

   $options = $theme_theme_options_settings;



    $theme_socialnetworks = '';

    if ( ( !$theme_socialnetworks = get_transient( 'theme_socialnetworks' ) ) && ( 1 == $flag ) )  {



        $theme_socialnetworks .='

            <div class="social-profiles clearfix">

                <ul>';



                $social_links = array(); 

                $social_links_name = array();

                $social_links_name = array( __( 'Facebook', 'theme' ),

                                            __( 'Twitter', 'theme' ),

                                            __( 'Google Plus', 'theme' ),

                                            __( 'Pinterest', 'theme' ),

                                            __( 'Youtube', 'theme' ),

                                            __( 'Vimeo', 'theme' ),

                                            __( 'LinkedIn', 'theme' ),

                                            __( 'Flickr', 'theme' ),

                                            __( 'Tumblr', 'theme' ),

                                            __( 'Myspace', 'theme' ),

                                            __( 'RSS', 'theme' )

                                            );

                $social_links = array(  'Facebook'      => 'social_facebook',

                                                'Twitter'       => 'social_twitter',

                                                'Google-Plus'   => 'social_googleplus',

                                                'Pinterest'     => 'social_pinterest',

                                                'You-tube'      => 'social_youtube',

                                                'Vimeo'         => 'social_vimeo',

                                                'Linked'            => 'social_linkedin',

                                                'Flickr'            => 'social_flickr',

                                                'Tumblr'            => 'social_tumblr',

                                                'My-Space'      => 'social_myspace',

                                                'RSS'               => 'social_rss'  

                                            );



                $i=0;

                foreach( $social_links as $key => $value ) {

                    if ( !empty( $options[ $value ] ) ) {

                        $theme_socialnetworks .=

                            '<li class="'.strtolower($key).'"><a href="'.esc_url( $options[ $value ] ).'" title="'.sprintf( esc_attr__( '%1$s on %2$s', 'theme' ), get_bloginfo( 'name' ), $social_links_name[$i] ).'" target="_blank">'.get_bloginfo( 'name' ).' '.$social_links_name[$i].'</a></li>';

                    }

                    $i++;

                }       



                $theme_socialnetworks .='

            </ul>

            </div><!-- .social-profiles -->';



        set_transient( 'theme_socialnetworks', $theme_socialnetworks, 86940 );   

    }

    echo $theme_socialnetworks;

}

endif;



/****************************************************************************************/

I even removed the full div, but it is still printing it.

Was it helpful?

Solution

Go to line 353 in library/structure/header-extensions.php to find the code for the output of these icons.

The layout is {BLOG NAME} on {SOCIAL NETWORK NAME}. It uses get_bloginfo( 'name' ) to get the name of your site. Is or has the title of your site been "Attitude"?

The icons use a transient and it's not clear from this file how that transient is cleared so if you've changed your site name and it's still showing up that will be why.

Run the following at the top of your functions.php to be sure.

delete_transient( 'attitude_socialnetworks' );

Remove after you've run once.

UPDATE: I just noticed you wanted to use "Facebook" etc as the titles. In that case you would modify line 353 of that file to:

'<li class="'.strtolower($key).'"><a href="'.esc_url( $options[ $value ] ).'" title="'.sprintf( esc_attr__( '%1$s', 'attitude' ), $social_links_name[$i] ).'" target="_blank">'.get_bloginfo( 'name' ).' '.$social_links_name[$i].'</a></li>';

Make sure to run the delete transient code after making this change.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top