How to link entire excerpt?
-
Good day people…
Hope you can help me. I need to know which kind of code I have to use to link the entire excerpt instead of just the title? I tried to convert at least the “read more” tag as a link with this code at the functions of my template:
<?php $themeOption = new themeOptions(); //function to replace invalid ellipsis with text linking to the post function elpie_excerpt($text) { return str_replace('[...]', '<a href="'. get_permalink($post->ID) . '">' . ' [… Mas Info]' . '</a>', $text); } add_filter('the_excerpt', 'elpie_excerpt');?>
It worked, but in the backend an error with the headers was affecting my site so I removed it.(Warning: Cannot modify header information)
My primary idea was to create a div tag wrapping the entire excerpt loop and linking it to the post.. but I dont know where or how to do it.If is not too much to ask, I would like somebody to guide me. Thank you so much in advance and happy holy days to y’all.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to link entire excerpt?’ is closed to new replies.