matthew halnan
asked 11 years ago
1 Answers
DominicStaff
answered 11 years ago

Hello Matthew !
To add the Weibo Social button to the bottom of the DW Trendy theme, you can do as the following:
1. Open the custom.php file in the folder path “\wp-content\themes\dw-trendy\lib” Find the line 61 to line 75.
Replace the following code:

   function dw_trendy_socials() {
  $social_links['facebook'] = dw_trendy_get_theme_option( 'facebook', '#' );
  $social_links['twitter'] = dw_trendy_get_theme_option( 'twitter', '#' );
  $social_links['google_plus'] = dw_trendy_get_theme_option( 'google_plus', '#' );
  $social_links['youtube'] = dw_trendy_get_theme_option( 'youtube', '#' );
  $social_links['linkedin'] = dw_trendy_get_theme_option( 'linkedin', '#' );
  ?>
  <?php if(count($social_links) > 0 ) { ?>
  <ul class="list-inline social-list">
    <?php if($social_links['facebook']!='') { ?><li class="social facebook"><a href="<?php echo $social_links['facebook']; ?>"><i class="fa fa-facebook"></i></a></li><?php } ?>
    <?php if($social_links['twitter']!='') { ?><li class="social twitter"><a href="<?php echo $social_links['twitter']; ?>"><i class="fa fa-twitter"></i></a></li><?php } ?>
    <?php if($social_links['google_plus']!='') { ?><li class="social google_plus"><a href="<?php echo $social_links['google_plus']; ?>"><i class="fa fa-google-plus"></i></a></li><?php } ?>
    <?php if($social_links['youtube']!='') { ?><li class="social youtube"><a href="<?php echo $social_links['youtube']; ?>"><i class="fa fa-youtube"></i></a></li><?php } ?>
    <?php if($social_links['linkedin']!='') { ?><li class="social linkedin"><a href="<?php echo $social_links['linkedin']; ?>"><i class="fa fa-linkedin"></i></a></li><?php } ?>
  </ul>

With new code:

   function dw_trendy_socials() {
  $social_links['facebook'] = dw_trendy_get_theme_option( 'facebook', '#' );
  $social_links['twitter'] = dw_trendy_get_theme_option( 'twitter', '#' );
  $social_links['google_plus'] = dw_trendy_get_theme_option( 'google_plus', '#' );
  $social_links['youtube'] = dw_trendy_get_theme_option( 'youtube', '#' );
  $social_links['linkedin'] = dw_trendy_get_theme_option( 'linkedin', '#' );
  $social_links['weibo'] = dw_trendy_get_theme_option( 'weibo', '#' );
  ?>
  <?php if(count($social_links) > 0 ) { ?>
  <ul class="list-inline social-list">
    <?php if($social_links['facebook']!='') { ?><li class="social facebook"><a href="<?php echo $social_links['facebook']; ?>"><i class="fa fa-facebook"></i></a></li><?php } ?>
    <?php if($social_links['twitter']!='') { ?><li class="social twitter"><a href="<?php echo $social_links['twitter']; ?>"><i class="fa fa-twitter"></i></a></li><?php } ?>
    <?php if($social_links['google_plus']!='') { ?><li class="social google_plus"><a href="<?php echo $social_links['google_plus']; ?>"><i class="fa fa-google-plus"></i></a></li><?php } ?>
    <?php if($social_links['youtube']!='') { ?><li class="social youtube"><a href="<?php echo $social_links['youtube']; ?>"><i class="fa fa-youtube"></i></a></li><?php } ?>
    <?php if($social_links['linkedin']!='') { ?><li class="social linkedin"><a href="<?php echo $social_links['linkedin']; ?>"><i class="fa fa-linkedin"></i></a></li><?php } ?>
    <?php if($social_links['weibo']!='') { ?><li class="social weibo"><a href="<?php echo $social_links['weibo']; ?>"><i class="fa fa-weibo"></i></a></li><?php } ?>
  </ul>

2. Open the customize.php file in the folder path “\wp-content\themes\dw-trendy\lib”  Find the line 315, then add the following code:

   $wp_customize->add_setting('dw_trendy_theme_options[weibo]', array(
    'default'        => '#',
    'capability'     => 'edit_theme_options',
    'type'           => 'option'
  ));
  $wp_customize->add_control('weibo', array(
    'label'      => __('Weibo', 'dw-trendy'),
    'section'    => 'dw_trendy_social_links',
    'settings'   => 'dw_trendy_theme_options[weibo]'
  ));

3. Log in to Dashboard > Customize > Social Links, then add your link to the Weibo social section.
Hope this helps !

matthew halnan
replied 11 years ago

Great, thanks!

Powered by DW Question & Answer Pro