Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 504799

Missing href error for Pinterest social share

$
0
0

Replies: 0

I have included pinterest share url in my footer with a custom icon as follows:

    <?php $pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
    <a href="//pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink($post->ID)); ?>&media=<?php echo $pinterestimage[0]; ?>&description=<?php the_title(); ?>"data-pin-custom="true" target="_blank"><i class="icon-pinterest"></i></a>

The sharing action works, but the pinterest icon show the error message “missing href”. I have been trying several things, but nothing gets rid of the error. I had previously included in my header.php pinit.js as the only solution working (at least found) to be able to embed pinterest content in articles:

    <script
        type="text/javascript"
        async defer
        src="//assets.pinterest.com/js/pinit.js"
    ></script>

I have noticed that if I remove the script, then the error goes away, why is that? I do need the ability to embed content too, how can I have both working, social sharing and embedding ability? Can you help? Is there a working alternative?

Thank you for your help,


Viewing all articles
Browse latest Browse all 504799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>