Text Exchange Read More for a Static Image - Wordpress

Asked

Viewed 28 times

-2

Guys I got the code

add_filter( 'the_content_more_link', 'modify_read_more_link' );
function modify_read_more_link() {

  return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'; 

}

This script is inside functions.php in wordpress. but I wanted to change the "you read more link text" by a png image I have and center it.

How can I do it? I don’t want to edit only the text I want to exchange for an image.

2 answers

0

return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'

replaces that line with:

return '<a class="more-link" href="' . get_permalink() . '"><img src=minhaimagem.png></a>'
  • remembering that this address of the image has to be the absolute address, ie: ->http://www.server.com.br/diretorio1/dir2/imagem.png

  • Thanks for the help, I made the change, did not present any fault, but after I saved stopped opening the site and it appears that a critical error occurred.

-1

Thanks for the help, I made the change, did not present any fault, but after I saved stopped opening the site and it appears that a critical error occurred.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.