Script code to automatically update the link in the header of the widget?
-
Hi all.
I installed the plugin and I’m using its widget in the home page of my site displaying it in a panel with a header stating “Latest Instagram”.
I have two other similar plugins/widgets: one for Facebook and one for Twitter, both with their own panel in the home page.
The guy who created my website made the links inside the panels’ headers refresh, so that each link points to the latest Facebook post and the latest tweet, respectively.
This is the code he wrote in the scripts.js file:
//facebook plugin (home)
$(‘.header.facebook’).attr(‘href’, $(‘.rfbp-post-link’).attr(‘href’));//Twitter plugin (home)
if($(‘.fetch-tweets .fetch-tweets-intent-reply a’).attr(‘href’)) {
var twID = $(‘.fetch-tweets .fetch-tweets-intent-reply a’).attr(‘href’);
twID = twID.replace(‘https://twitter.com/intent/tweet?in_reply_to=’, ”);setTimeout(function() {
$(‘.header.twitter’).attr(‘href’, ‘https://twitter.com/PsmTickling/status/’+twID);
}, 500);Can I – and if so, how – do the same thing with this plugin and its widget?
- The topic ‘Script code to automatically update the link in the header of the widget?’ is closed to new replies.