Home › Forums › Basel support forum › SOCIAL LINKS – VIDEO BACKGROUND – RECENT POST HOMEPAGE › Reply To: SOCIAL LINKS – VIDEO BACKGROUND – RECENT POST HOMEPAGE
June 23, 2016 at 5:06 pm
#1518
Artem Temos
Keymaster
Change this function code to the following to add youtube link and fix mail link
function basel_shortcode_social($atts) {
extract(shortcode_atts( array(
'type' => 'share',
'align' => 'center',
'tooltip' => 'no',
'style' => 'default', // circle colored
'size' => 'default', // circle colored
'el_class' => '',
), $atts ));
$target = "_blank";
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true);
ob_start();
?>
<ul class="social-icons text-<?php echo esc_attr( $align ); ?> icons-design-<?php echo esc_attr( $style ); ?> icons-size-<?php echo esc_attr( $size ); ?> social-<?php echo esc_attr( $type ); ?> <?php echo esc_attr( $el_class ); ?>">
<?php if ( basel_get_opt( 'social_email' ) != ''): ?>
<li class="social-email"><a href="mailto:<?php echo ($type == 'follow') ? basel_get_opt( 'social_email' ) : basel_get_opt( 'social_email' ) . '?subject=' . __('Check this ', 'xtemos') . get_the_permalink(); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-envelope"></i><?php _e('Email', 'xtemos') ?></a></li>
<?php endif ?>
<?php if ( $type == 'share' || basel_get_opt( 'fb_link' ) != ''): ?>
<li class="social-facebook"><a href="<?php echo ($type == 'follow') ? basel_get_opt( 'fb_link' ) : 'https://www.facebook.com/sharer/sharer.php?u=' . get_the_permalink(); ?>" target="<?php echo esc_attr( $target ); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-facebook"></i><?php _e('Facebook', 'xtemos') ?></a></li>
<?php endif ?>
<?php if ( $type == 'share' || basel_get_opt( 'twitter_link' ) != ''): ?>
<li class="social-twitter"><a href="<?php echo ($type == 'follow') ? basel_get_opt( 'twitter_link' ) : 'http://twitter.com/share?url=' . get_the_permalink(); ?>" target="<?php echo esc_attr( $target ); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-twitter"></i><?php _e('Twitter', 'xtemos') ?></a></li>
<?php endif ?>
<?php if ( $type == 'share' || basel_get_opt( 'google_link' ) != ''): ?>
<li class="social-google"><a href="<?php echo ($type == 'follow') ? basel_get_opt( 'google_link' ) : 'http://plus.google.com/share?url=' . get_the_permalink(); ?>" target="<?php echo esc_attr( $target ); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-google-plus"></i><?php _e('Google', 'xtemos') ?></a></li>
<?php endif ?>
<?php if ( $type == 'follow' && basel_get_opt( 'isntagram_link' ) != ''): ?>
<li class="social-instagram"><a href="<?php echo ($type == 'follow') ? basel_get_opt( 'isntagram_link' ) : '' . get_the_permalink(); ?>" target="<?php echo esc_attr( $target ); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-instagram"></i><?php _e('Instagram', 'xtemos') ?></a></li>
<?php endif ?>
<?php if ( $type == 'share' || basel_get_opt( 'pinterest_link' ) != ''): ?>
<li class="social-pinterest"><a href="<?php echo ($type == 'follow') ? basel_get_opt( 'pinterest_link' ) : 'http://pinterest.com/pin/create/button/?url=' . get_the_permalink() . '&media=' . $thumb_url[0]; ?>" target="<?php echo esc_attr( $target ); ?>" class="<?php if( $tooltip == "yes" ) echo 'basel-tooltip'; ?>"><i class="fa fa-pinterest"></i><?php _e('Pinterest', 'xtemos') ?></a></li>
<?php endif ?>
<li class="social-youtube"><a href="http://youtube.com/YOUR_LINK" target="<?php echo esc_attr( $target ); ?>"><i class="fa fa-youtube"></i><?php _e('Youtube', 'xtemos') ?></a></li>
</ul>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
add_shortcode( 'social_buttons', 'basel_shortcode_social' );
4. Background video is possible to add to row with Visual Composer. See screenshot
5. We need to see your site to help in this question. Now we just get 403 error.