0

My current demo site is http://www.dpimax.com/v2/ scroll down to news, so when you clikc on read more I want it to go to a specific anchor point on the single.php which I already have name #placeholder, the code I am using on the function.php for the read more is, I'm not sure how to integrate the anchor here, your help would be much appreciated.

function new_excerpt_more( $more ) {
return ' <a href="'. get_permalink( get_the_ID() ) . '"> '
       . __('<br/><br/> Read More') . '</a>';
}

add_filter( 'excerpt_more', 'new_excerpt_more');

function custom_excerpt_length( $length ){
return 35;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

1 Answer 1

0
function new_excerpt_more( $more ) {
return ' <a href="'. get_permalink( get_the_ID() ) . '#placeholder"> '
       . __('<br/><br/> Read More') . '</a>';
}

add_filter( 'excerpt_more', 'new_excerpt_more');

I think that should do it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.