无法更改标题链接的标题

时间:2014-02-20 10:08:36

标签: php wordpress wordpress-theming title

我正在使用wordpress主题。我已经成功配置了它,但是当我尝试将社交图标(例如,facebook)置于顶部时,我需要将相同的标题从“Facebook上的主题”更改为“单击此处以赞”。我试图更改admin文件夹下的theme-options.php文件以及头文件,但没有成功。即使我创建并用“facebook”替换每个标题,但它仍然被显示为“Facebook上的主题”。

文件header-extensions.php下面的代码正在打印此代码。

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



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;



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

我甚至删除了完整的div,但它仍在打印它。

1 个答案:

答案 0 :(得分:1)

转到library / structure / header-extensions.php中的第353行,找到这些图标输出的代码。

{Social NETWORK NAME}上的{BLOG NAME}布局。它使用get_bloginfo('name')来获取您网站的名称。您网站的标题是“态度”还是“已经”?

这些图标使用了一个瞬态,而且从这个文件中不清楚该瞬态是如何被清除的,所以如果你改变了你的网站名称并且它仍然显示出来就是原因。

在functions.php的顶部运行以下内容以确定。

delete_transient( 'attitude_socialnetworks' );

运行一次后删除。

更新:我刚注意到您想使用“Facebook”等作为标题。在这种情况下,您可以将该文件的第353行修改为:

'<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>';

确保在进行此更改后运行删除瞬态代码。