Blogger Code Image linking to post page
Blogger Code Image linking to post page
Is this possible to achieve in blogger?
My goal is to make Static page images to become clickable and link it to the actual post page.
I know its possible by editing each post but I want to make it automatic. For example: In 9gag.com when you click the image from the homepage it will actually link you to the post page.
I want to do the same but in blogger. Something like this
<b:if cond='data:blog.pageType == "static_page"'><a expr:href='data:post.url'><static page images></a></b:if>
Screenshot:
1 Answer
1
Given that jQuery is available, you should be able to do it with something like this:
$('a.title').each(function()
var href = this.href;
$(this).next('.article').find('img:not(a img)').each(function()
var a = $('<a/>',
'href': href
);
$(this).replaceWith(a);
a.append(this);
);
);
Of course not knowing the structure of your HTML, I just made up class names.
Thanks for the help sir. That was my 2nd option but luckily I found a way to do it using blogger codes.
– Jm Agas
Jun 7 '12 at 19:20
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What's the structure of your HTML, specifically for the posts showing on the frontpage?
– Brilliand
Jun 6 '12 at 21:44