StyledThemes

Blog Pictures on Homepage

Home Forums WordPress Themes – Premium Lavish Pro Blog Pictures on Homepage

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17015
    Greg Rockwell
    Participant

    Hello! Is there a way to make the Feature Image for Blog Articles an active link that leads to the article? It’s counter intuitive for me to have to click on the Blog title instead of the blog picture to get to the article.

    See attached picture for more explanation.

    http://www.thrivedc.org
    BlogPictures.jpg

    Attachments:
    You must be logged in to view attached files.
    #17016
    Sushil Adhikari
    Moderator

    Hi Greg Rockwell,

    Please add this code on child theme functions.php file to make thumbnail image clickable: Note: If you are technically sound on WordPress then only please proceed this steps:

    //first remove the function  attached to a lr_thumbnail action hook.
    add_action('wp_head', 'lavish_child_remove_action');
    Function lavish_child_remove_action () {
    	remove_action('lr_thumbnail', 'lr_thumbnail_fnc');
    }
    
    //Again add the function  attached to a lr_thumbnail action hook.
    add_action('lr_thumbnail', 'lavish_child_add_permalink');
    Function lavish_child_add_permalink() {
    	$get_theme_mod_blog1 = get_theme_mod('blog_style');
    
        if (!($get_theme_mod_blog1 == 'manosaryleft') && !($get_theme_mod_blog1 == 'manosaryright') && !($get_theme_mod_blog1 == 'manosarywide')) {
            if (!($get_theme_mod_blog1 == 'boxedwide') && !($get_theme_mod_blog1 == 'boxedleft') && !($get_theme_mod_blog1 == 'boxedright')) {
                if ( has_post_thumbnail()) {
                    $featuredimage = get_theme_mod( 'featured_image', 'big' );
                        switch ($featuredimage) {
                            case "big" :
                            echo '
    '; the_post_thumbnail('big'); echo '
    '; break; case "small" : echo '
    '; the_post_thumbnail('medium'); echo '
    '; break; } } } else { if ( has_post_thumbnail()) { $featuredimage = get_theme_mod( 'featured_image', 'big' ); switch ($featuredimage) { case "big" : echo '
    '; the_post_thumbnail('big'); echo '
    '; break; case "small" : echo '
    '; the_post_thumbnail('medium'); echo '
    '; break; } } } } else { if ( has_post_thumbnail()) { echo '
    '; ?> <a href="https://www.styledthemes.com/"> <?php echo '
    '; } } }

    Note: Using child theme will prevents your changes to lost on theme update.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.