With Newspaper, how to add after each images in single a pinterest button?

Posted in: Newspaper
Post count: 24

To add after each images a pinterest button should I to edit the function get_content() from ./includes/wp_booster/td_module_single_base.php:class td_module_single_base ?

and use regexp end replace into $content variable ?

I do not want use javascript as this job could be done at server side.

For this the pseudocode:
<xmp>
for each image in “.td-post-content img”:
# get image url
id = image.getAttribute(“data-attachement-id”)
size = image.getAttribute(“data-orig-size”)
pinurl = wp_get_attachment_image_src( id, size )
# insert after this img tag this link
ID)); ?>&media=’+pinurl+’&is_video=false&description=<?php echo urlencode(get_the_excerpt()); ?>” class=”icon icon-pinterest” target=”_blank”>Pin‘);
end for
</xmp>

Thanks for your help

Post count: 20688

Hi,

I believe it would be much easier to simply use a plugin that has this option. Search and try a few plugins and select the one you like and has what you need.
I am sure that there are many plugins to choose from to achieve something like this for the post images.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.