Forums
Forums / Plugins / Image in next post link
(@sytheveenje)
14 years, 4 months ago
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 ‘.
(@esmi)
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" />');?>
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;
The topic ‘Image in next post link’ is closed to new replies.