Adding Likedin share button
-
Hi, I need to add a button for Linkedin share, I tried the following code in the template file:
// Linkedin if ( 'linkedin' == $site ) { ?> <li class="linkedin"> <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo rawurlencode( esc_url( $product_url ) ); ?>&media=<?php echo wp_get_attachment_url( get_post_thumbnail_id() ); ?>&description=<?php echo rawurlencode( $product_title ); ?>" target="_blank" onclick="ops_onClick( this.href );return false;"> <span class="ops-icon-wrap"> <svg class="ops-icon" aria-labelledby="ops-linkedin-icon" role="img" viewBox="0 0 24 24" xmlns="https://www.w3.org/2000/svg"> <path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/> </svg> </span> <div class="product-share-text"><?php esc_html_e( 'Share This Class', 'ocean-product-sharing' ); ?></div> </a> </li> <?php }
but it doesn’t work, I don’t know where is the issue here, and also I need to find the proper svg path for the icon.
Can I get some help here?
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding Likedin share button’ is closed to new replies.