Raj Kara
asked 7 years ago

Hi – Does anyone know how to add pinterest to the social links top right menu.
Cheers

2 Answers
DominicStaff
answered 7 years ago

– Add pinterest to the social links top right menu. You can do as the following:
1. open the header.php file, find & remove the line 32 to line 69, then add new code below:

<?php  
$facebook = dw_get_theme_option('facebook_link');
$twitter = dw_get_theme_option('twitter_link');
$instagram = dw_get_theme_option('instagram_link');
$youtube = dw_get_theme_option('youtube_link');
$gplus = dw_get_theme_option('google_plus_link');
$linkedin = dw_get_theme_option('linkedin_link');
$flickr = dw_get_theme_option('flickr_link');
$pinterest= dw_get_theme_option('pinterest_link');
if( $facebook || $youtube || $gplus || $linkedin || $flickr || $instagram || $twitter || $pinterest  ) :
?>
<div class="social-link">
  <ul>
  <?php if( $facebook ) : ?>
  <li id="facebook_link"><a href="<?php echo $facebook ?>" class="facebook"><i class="icon-facebook"></i></a></li>
  <?php endif; ?>
  <?php if( $twitter ) : ?>
  <li id="twitter_link"><a href="<?php echo $twitter ?>" class="twitter"><i class="icon-twitter"></i></a></li>
  <?php endif; ?>
  <?php if( $instagram ) : ?>
  <li id="instagram_link"><a href="<?php echo $instagram ?>" class="instagram"><i class="icon-instagram"></i></a></li>
  <?php endif; ?>
  <?php if( $youtube ) : ?>
  <li id="youtube_link"><a href="<?php echo $youtube ?>" class="youtube"><i class="icon-youtube"></i></a></li>
  <?php endif; ?>
  <?php if( $gplus ) : ?>
  <li id="google_plus_link"><a href="<?php echo $gplus ?>" class="google-plus"><i class="icon-google-plus"></i></a></li>
  <?php endif; ?>
  <?php if( $linkedin ) : ?>
  <li id="linkdedin_link"><a href="<?php echo $linkedin ?>" class="linkedin"><i class="icon-linkedin"></i></a></li>
  <?php endif; ?>
  <?php if( $flickr ) : ?>
  <li id="flickr_link"><a href="<?php echo $flickr ?>" class="flickr"><i class="icon-flickr"></i></a></li>
  <?php endif; ?>
  <?php if( $pinterest ) : ?>
  <li id="pinterest_link"><a href="<?php echo $pinterest ?>" class="pinterest"><i class="icon-pinterest"></i></a></li>
  <?php endif; ?>
  </ul>

2. Open the theme-customization.php file in the folder path “\wp-content\themes\dw-fixel\inc“. Add the following code under line 133.
  

//pinterest
     $wp_customize->add_setting('dw_general_options[pinterest_link]', array(
        'default'        => '',
        'capability'     => 'edit_theme_options',
        'type'           => 'option',
        'transport' => 'postMessage'
    ));
    $wp_customize->add_control('dw_general_options_pinterest_link', array(
        'label'      => __('Pinterest link', DW_TEXTDOMAIN),
        'section'    => 'dw_general_settings',
        'settings'   => 'dw_general_options[pinterest_link]',
        'type'       => 'text'
    ));

3. Log in to Dashboard > Customize > General Settings, then add the Pinterest link.
Hope this helps !

Raj Kara
replied 7 years ago

Thanks Domonic – will give this a go.

Raj Kara
replied 7 years ago

Hi – Have done as your instructions and the icon is not visible. Please help!

Kido D
answered 7 years ago

Hi Raj,
To resolve the issue, you can open up the header.php file in themes/dw-fixel folder, find the code below:

<?php if( $flickr ) : ?>
<li id="flickr_link"><a href="<?php echo $flickr ?>" class="flickr"><i class="icon-flickr"></i></a></li>
<?php endif; ?>

… and change it into this:

<?php if( $flickr ) : ?>
<li id="flickr_link"><a href="<?php echo $flickr ?>" class="flickr"><i class="icon-flickr"></i></a></li>
<?php endif; ?>
<li id="pinterest_link"><a href="#link_to_your_pinterest" class="pinterest"><i class="icon-pinterest"></i></a></li>

Then, go to Dashboard > Appearances > Customize > Custom Code, and add the following code to Header Code section:

<style>
.social-link li:hover a.pinterest {
background-color: #cb2027;
}
</style>

Hope this helps!

Raj Kara
replied 7 years ago

Hi – thats great, the icon is there BUT I cannot change the link info.
I have gone to Appearance>Customise>General and added the url but its not changing the link which when clicked points to http://theretailroom.co.uk/#link_to_your_pinterest.

Could you please give me an idea where this should be changed?
Cheers

Raj Kara
replied 7 years ago

Hi again – I’ve just tested the pinterest link by adding it to the linkedin icon – this does go to the right pinterest page. Seems there is a problem with the code that controls the pinterest icon. If you could please have a look and help!
Cheers

Kido D
replied 7 years ago

Hi!

In the code above (header.php file), just change the sample link (#link_to_your_pinterest) to your actual link.

Also, we are working on the updated version of this theme (include printerest link added), maybe we’ll release it on this weekend, so stay tuned!

Cheers

Powered by DW Question & Answer Pro