Featured Images to work with SLB
-
Was asked to create a new topic
AnywayHi I’ve asked before (about a year ago) but not experienced enough to follow the directions I just don’t get it Anyway continued trying to figure this thing out I am using a child theme called MH NewsMagazine to the theme MH Magazine lite In the child theme I did put a copy of the content-single.php So far no problems but when I added the code to the line <?php mh_magazine_lite_featured_image(); ?> I got 2 images on the page One where the featured images is and below the full sized image – clickable but way to big I wanted the lightbox to work on the featured image This is how I wrote it
<?php mh_magazine_lite_featured_image();
// Link post thumbnail to full-size image.
if ( has_post_thumbnail() ) {
$thumbnail = [
// URI of full-size post thumbnail image.
‘uri’ => get_the_post_thumbnail_url( null, ‘full’ ),
// HTML to display post thumbnail.
‘img’ => get_the_post_thumbnail(),
];
// Build thumbnail link.
$thumbnail[‘link’] = sprintf( ‘%s‘, esc_attr( $thumbnail[‘uri’] ), $thumbnail[‘img’] );// Display full-size image in lightbox when clicked.
if ( function_exists( ‘slb_activate’ ) ) {
$thumbnail[‘link’] = slb_activate( $thumbnail[‘link’] );
}// Display post thumbnail.
echo $thumbnail[‘link’];
}
?>`The page I need help with: [log in to see the link]
- The topic ‘Featured Images to work with SLB’ is closed to new replies.