Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #145305
    effess
    Participant

    http://www.rebecca-rosenberg.com/blog/ How can I remove the featured image link to the permalink. I found a way to add a custom field (functions.php in the child theme), but it still goes to the permalink first. (Currently NOT using the external link.) Thanks.

    // Add External Link to Featured Image with Custom Field

    add_filter(‘post_thumbnail_html’,’add_external_link_on_page_post_thumbnail’,10);
    function add_external_link_on_page_post_thumbnail( $html ) {
    if( is_singular() ) {
    global $post;
    $name = get_post_meta($post->ID, ‘ExternalUrl’, true);
    if( $name ) {
    $html = ‘‘ . $html . ‘‘;
    }
    }
    return $html;
    }

    #145323
    Skandha
    Keymaster

    @effess: Go to => Appearance => Customize => Additional CSS and add the following CSS Code.

    .featured-image {
    	pointer-events:none;
    }

    Let me know if this works out.
    Kind Regards,
    Skandha

    #145372
    effess
    Participant

    That turns off the link action completely, but I’m trying to link the featured image to an external URL (not to the permalink). Thank you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Remove permalink from featured image’ is closed to new replies.