Twitter card not showing up


#1

Hi there,

Re: page on http://saveafricanhistory.handsupstaging.com/

I have a page with various Tweet buttons for different sections of a page.

The problem is the Twitter card is not being applied to the tweets. Using the Twitter cards validator, I can see that the cards are configured and whitelisted ok for the relevant page.

Here is my Tweet button code (excuse the PHP variables output for parameters)…

<a href="https://twitter.com/intent/tweet?text=<?=$tweet_text;?>&url=<?=$url;?>&data-counturl=<?php echo "http://$_SERVER[HTTP_HOST]/"; ?>" target="_blank" title="Tweet" onclick="window.open('https://twitter.com/intent/tweet?text=<?=$tweet_text;?>&data-counturl=<?php echo $url; ?>'); return false;"><button class="<?=$hide_class;?> tw"><i class="fa fa-twitter"></i> Tweet</button></a>

Thanks for any help

Kevin


#2

Hi @KevinWorrall, beautiful site!

I think I found your issue. The URL is missing from the pre-composed Tweet. Looking through your code you have no “url” parameter defined in your onclick javascript. Try adding that and I’m sure it will work.


#3

Great, that is indeed the issue. Thanks for taking the time to look into it and reply.


#4