Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   add class from Pinterest to post-thumbnail (http://forum.bytesforall.com/showthread.php?t=23329)

_kimberley Nov 10, 2015 01:32 AM

add class from Pinterest to post-thumbnail
 
I would like to add some html to the featured post thumbnail, but the thumbnail only! I would like to add data-pin-no-hover="true" and nopin="nopin" from Pinterest

juggledad Nov 10, 2015 04:24 AM

There is no theme option for this, you will need to edit bfa_post_parts.php and add your code into it. search for 'function bfa_post_bodycopy'

_kimberley Nov 10, 2015 06:05 AM

Only no option for html
PHP Code:

if(has_post_thumbnail()): ?>
                <a href="<?php the_permalink() ?>"> <?php the_post_thumbnail(); ?></a>

and if I search for the_post_thumbnail(), I think it will be a global configuration... or not?

juggledad Nov 10, 2015 08:55 AM

you can put html there, you just have to make sure you swap between the php and html - if it's in between a <?php and ?> it is php, outside that it is html

_kimberley Nov 11, 2015 12:10 AM

Not something like <img src="image.jpg" class="nopin" width="100px" height="100px"> right?

juggledad Nov 11, 2015 03:19 AM

ahhh, the <img...> is generated in the the_post_thumbnail() function which is a WordPress function and not part of the theme. You can pass parameters to it. see https://codex.wordpress.org/Function...post_thumbnail


All times are GMT -6. The time now is 02:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.