1

I would like to make the previous and next post link into an image instead of a link text e.g.

<a href="%link"><img src=""  /> </a>

so whatever the size of the image it would be clickable i tried adding a css through filter but the image just stays as a background(not clickable)

function post_left_attributes($output) {
    $injection = 'class="arrow_left"';

    return str_replace('<a href=', '<a '.$injection.' href=', $output);
}

function post_right_attributes($output) {
    $injection = 'class="arrow_right"';
    return str_replace('<a href=', '<a '.$injection.' href=', $output);
}
3
  • they are different (not looking for featured image but make the next and previous into image only )
    – JPL
    Commented Aug 13, 2014 at 3:33
  • The 1st parameter is $format. You can use that for your image Commented Aug 13, 2014 at 4:03
  • If its for arrows, you could use dashicons Commented Aug 13, 2014 at 4:14

1 Answer 1

0

You can customize previous_post_link like this

previous_post_link('%link','<img src="link_to_image"/>');

Not the answer you're looking for? Browse other questions tagged or ask your own question.