Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, as noted in the thread you’re referring to, manually adding SLB-specific attributes is not recommended as they are intended for internal use only and thus can change at any time.

    You can use slb_activate() to activate valid links that are not inside of a post/page. Here is more information on using slb_activate().

    Here is a more recent thread with information on using slb_activate() with the post thumbnail. The code would replace the current code in the theme used to display the featured image.

    Thread Starter soma2000

    (@soma2000)

    <!– ADD LARGE FEATURED IMAGE & LINK TO FULL IMAGE –>
    <?php
    if ( has_post_thumbnail() ) {
    $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘full’ );
    $content = ‘‘ . get_the_post_thumbnail( $post_id, ‘large’ ) . ‘‘;
    if ( function_exists(‘slb_activate’) ) {
    $content = slb_activate($content);
    echo $content;
    }
    }
    ?>`

    Ok, so the above should be the code to use slb_activate to enable featured image pop-up. May I know where should I insert the above code?

    Thanks,

    Plugin Author Archetyped

    (@archetyped)

    Hi, yep that code should work fine. For some reason, the link to the previous thread disappeared from my last reply, so I’m glad you were able to locate it.

    For future reference, here is the other thread: https://www.ads-software.com/support/topic/help-activating-slb-in-my-theme

    Also, as previously mentioned, the SLB-activated code would replace the theme’s code used to display the post thumbnail. This can differ from theme to theme, so I would recommend contacting your theme’s developer for specific instructions on where modifications would need to be made.

    Thread Starter soma2000

    (@soma2000)

    I have checked with theme developer, I should be able to add the mentioned code to functions.php.

    I add the above code to the end of functions.php but somehow it doesn’t work.

    I could have done something wrong, any advice from your side?

    Many thanks.

    Plugin Author Archetyped

    (@archetyped)

    The theme’s developer would likely know best, but simply adding the aforementioned code to the theme’s functions.php file is unlikely to do anything.

    As previously mentioned, in most themes, you’ll want to replace the instances where the standard post thumbnail is displayed. This is usually done using the the_post_thumbnail() (documentation).

    Thread Starter soma2000

    (@soma2000)

    Yes, the theme developer at https://foxland.fi has helped me to work out the script.

    The script works in the Eemeli pro child theme.

    You can take a look at my site here https://SnapEscape.com.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Featured image’ is closed to new replies.