WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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);
share|improve this question

marked as duplicate by toscho Aug 16 '14 at 1:07

This question was marked as an exact duplicate of an existing question.

they are different (not looking for featured image but make the next and previous into image only ) – JPL Aug 13 '14 at 3:33
The 1st parameter is $format. You can use that for your image – Brad Dalton Aug 13 '14 at 4:03
If its for arrows, you could use dashicons – Brad Dalton Aug 13 '14 at 4:14

You can customize previous_post_link like this

previous_post_link('%link','<img src="link_to_image"/>');
share|improve this answer

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