Home › Forums › WoodMart support forum › Social media link on sidebar
Social media link on sidebar
- This topic has 7 replies, 2 voices, and was last updated 3 years, 8 months ago by Elise Noromit.
-
AuthorPosts
-
April 10, 2021 at 9:38 am #281175
arven1ParticipantHello,
Code that you provided me for having email links in the sidebar social menu is not working anymore. That is custom code that work on version 5 is not working anymore on version 6.
Here is the code:
// Email Us button on the social sidebar (left)
if( ! function_exists( ‘woodmart_shortcode_social’ )) {
function woodmart_shortcode_social($atts) {
extract(shortcode_atts( array(
‘type’ => ‘share’,
‘align’ => ‘center’,
‘tooltip’ => ‘no’,
‘style’ => ‘default’,
‘size’ => ‘default’,
‘form’ => ‘circle’,
‘color’ => ‘dark’,
‘css_animation’ => ‘none’,
‘el_class’ => ”,
‘page_link’ => false,
), $atts ));$target = “_blank”;
$classes = ‘woodmart-social-icons’;
$classes .= ‘ text-‘ . $align;
$classes .= ‘ icons-design-‘ . $style;
$classes .= ‘ icons-size-‘ . $size;
$classes .= ‘ color-scheme-‘ . $color;
$classes .= ‘ social-‘ . $type;
$classes .= ‘ social-form-‘ . $form;
$classes .= ( $el_class ) ? ‘ ‘ . $el_class : ”;
$classes .= woodmart_get_css_animation( $css_animation );$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id, ‘thumbnail-size’, true);if ( ! $page_link ) {
$page_link = get_the_permalink();
}if ( woodmart_woocommerce_installed() && is_shop() ) $page_link = get_permalink( get_option( ‘woocommerce_shop_page_id’ ) );
if ( woodmart_woocommerce_installed() && ( is_product_category() || is_category() ) ) $page_link = get_category_link( get_queried_object()->term_id );
if ( is_home() && ! is_front_page() ) $page_link = get_permalink( get_option( ‘page_for_posts’ ) );ob_start();
?><div class=”<?php echo esc_attr( $classes ); ?>”>
<?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_fb’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘fb_link’ ) != ”)): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-facebook”>
<i class=”fa fa-facebook”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Facebook’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_twitter’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘twitter_link’ ) != ”)): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-twitter”>
<i class=”fab fa-twitter”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Twitter’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘isntagram_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-instagram”>
<i class=”fab fa-instagram”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Instagram’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘youtube_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-youtube”>
<i class=”fab fa-youtube”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘YouTube’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_pinterest’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘pinterest_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-pinterest”>
<i class=”fab fa-pinterest”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Pinterest’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘tumblr_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-tumblr”>
<i class=”fa fa-tumblr”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Tumblr’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_linkedin’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘linkedin_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-linkedin”>
<i class=”fa fa-linkedin”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘linkedin’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘vimeo_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-vimeo”>
<i class=”fa fa-vimeo”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Vimeo’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘flickr_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-flickr”><i class=”fa fa-flickr”></i><span class=”woodmart-social-icon-name”><?php esc_html_e(‘Flickr’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘github_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-github”><i class=”fa fa-github”></i><span class=”woodmart-social-icon-name”><?php esc_html_e(‘GitHub’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘dribbble_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-dribbble”><i class=”fa fa-dribbble”></i><span class=”woodmart-social-icon-name”><?php esc_html_e(‘Dribbble’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘behance_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-behance”>
<i class=”fa fa-behance”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Behance’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘soundcloud_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-soundcloud”>
<i class=”fa fa-soundcloud”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Soundcloud’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘spotify_link’ ) != ”): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-spotify”>
<i class=”fa fa-spotify”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Spotify’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_ok’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘ok_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-ok”>
<i class=”fa fa-odnoklassniki”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Odnoklassniki’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘share’ && woodmart_get_opt(‘share_whatsapp’) || ( $type == ‘follow’ && woodmart_get_opt( ‘whatsapp_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”whatsapp-desktop <?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-whatsapp”>
<i class=”fab fa-whatsapp”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘WhatsApp’, ‘woodmart’) ?></span>
<?php if ( $type == ‘share’ && woodmart_get_opt(‘share_vk’) || ( $type == ‘follow’ && woodmart_get_opt( ‘vk_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-vk”>
<i class=”fa fa-vk”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘VK’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘follow’ && woodmart_get_opt( ‘snapchat_link’ ) != ” ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-snapchat”>
<i class=”fa fa-snapchat-ghost”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Snapchat’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( $type == ‘share’ && woodmart_get_opt(‘share_tg’) || ( $type == ‘follow’ && woodmart_get_opt( ‘tg_link’ ) != ” ) ): ?>
” target=”<?php echo esc_attr( $target ); ?>” class=”<?php if( $tooltip == “yes” ) echo ‘woodmart-tooltip’; ?> woodmart-social-icon social-tg”>
<i class=”fa fa-telegram”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Telegram’, ‘woodmart’) ?></span>
<?php endif ?><?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_email’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘social_email’ ) ) ): ?>
woodmart-social-icon social-email”>
<i class=”fa fa-envelope”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Contatto’, ‘woodmart’) ?></span>
<?php endif ?></div>
<?php
$output = ob_get_contents();
ob_end_clean();return $output;
}
}From all this code, what I need is:
<?php if ( ( $type == ‘share’ && woodmart_get_opt(‘share_email’) ) || ( $type == ‘follow’ && woodmart_get_opt( ‘social_email’ ) ) ): ?>
woodmart-social-icon social-email”>
<i class=”fa fa-envelope”></i>
<span class=”woodmart-social-icon-name”><?php esc_html_e(‘Contact Us’, ‘woodmart’) ?></span>
<?php endif ?>Is there any easier way of inserting this into functions so link would be when clicking on the icon Email Us?
April 11, 2021 at 8:23 am #281499
Elise NoromitMemberHello,
Please recreate all the actions we provided you to generate new valid custom code.
Best Regards
April 11, 2021 at 9:19 am #281528
arven1ParticipantOk, please check this topic: https://xtemos.com/forums/topic/include-email-inside-of-links-to-social-profiles/
April 12, 2021 at 7:22 am #281755
Elise NoromitMemberHello,
WoodMart 6.0 has changed considerably and you need to replicate all actions you have taken:
1. Find this file
woodmart/inc/shortcodes/social.php
2. You need to copy the functionwoodmart_shortcode_social()
into the functions.php of the child theme http://prntscr.com/qu201l
3. Make changes like this: http://prntscr.com/qtwtlvIf you have any questions please feel free to contact us.
Best Regards
April 12, 2021 at 3:17 pm #282019
arven1ParticipantOk thank you. I can see that now those nice buttons with an icon looks terrible out of box like (image in attachment). How can I diplay those nice icons with no name of a social network just icons like they were before (and all of them were same sized)?
Attachments:
You must be logged in to view attached files.April 12, 2021 at 7:20 pm #282111
Elise NoromitMemberHello,
Please provide your site admin access to the private area.
Best Regards
April 12, 2021 at 10:00 pm #282152
arven1ParticipantI’m sending details in private section. Let me know what you do.
April 13, 2021 at 6:00 pm #282469
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Global:
.wd-icon-name{ display:none; }
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register