• Hi there,

    I couldn’t find a solution on the forum, so here is my first post.

    I want to use images for my next/previous post links, but I want to link to them using the bloginfo(); function.

    I can’t get it to work. I hope someone can tell me what’s wrong in this syntax.

    <?php next_post_link( '%link', __( '<img src=" '. echo get_template_directory_uri(); .'/images/arrow_right.png">', 'twentyeleven' ) ); ?>

    I also tried without the dots and with .’ instead of ‘.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try:

    <?php
    $img_src = get_template_directory_uri(); .'/images/arrow_right.png';
    next_post_link( '%link', '<img src=" '. $img_src . '" width="xx" height="yy" alt="Next post" />');?>
    Thread Starter sytheveenje

    (@sytheveenje)

    Thanks Esmi. That does also give an error.

    Parse error: syntax error, unexpected ‘.’ in theme/sidebar.php on line 13

    That’s the dot in the second line in your code.

    I have found a workaround, but no solution. I fixed it with a CSS backgroundimage and text-indent: -9999;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image in next post link’ is closed to new replies.