I’m guessing the error is a duplicate error, right?
When I created the portfolio template and added the “Custom Read More” code, I added the one from the StudioPress tutorial. Which means if you add the same code from the tutorial and add it to your functions file for other areas of your site then it will cause a duplicate error…..but only on the portfolio page. So the simple solution is to just rename the function and everything should work.
Here is the way I do it now –
add_filter( 'excerpt_more', 'portfolio_read_more_link' );
add_filter( 'get_the_content_more_link', 'portfolio_read_more_link' );
add_filter( 'the_content_more_link', 'portfolio_read_more_link' );
/**
* Custom Read More link.
*
* @author Wes Straham
* @since 1.0.0
*/
function portfolio_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '" rel="nofollow">Read More</a>';
}
It’s the same code, I just renamed the functions.
Let me know if that makes sense.