Support » Theme: Adamos » Slider Link to Post

  • Resolved cren1985

    (@cren1985)


    Hi Ossie,

    instead of using the headline of the black box in the slider to redirect to the post the slider image refers to I wanted the slider image itself to serve as link to the post.

    I removed the corresponding values in the header.php to remove the box in the slider but I have no clue how to use the slider image as link.

    I would greatly appreciate your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Template Express

    (@danstriker)

    hello cren,

    in the custom-home.php remove the <a href="<?php the_permalink() ?>"> </a> from the title and excerpt and add it to the thumbnail

    Thank you for your help, I got what I needed by adding this to my functions.php

    // THIS LINKS THE THUMBNAIL TO THE POST PERMALINK
    
    add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
    
    function my_post_image_html( $html, $post_id, $post_image_id ) {
    
    	$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
    
    	return $html;
    }
    Theme Author Template Express

    (@danstriker)

    excellent – good luck with your website

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Slider Link to Post’ is closed to new replies.