With Genesis when you select archives to display excerpts, you don’t get a read more link or button, just some dots.
Although you can click on the title, this isn’t intuitive or user friendly.
The following code snippet can handle this
add_filter( 'the_excerpt', 'bw_excerpt_read_more_link' ); function bw_excerpt_read_more_link( $output ) { if( 'post' === get_post_type() ) { $btn="<div class ='read-more'>"; $btn.="<a class='bw-link' href='".get_permalink( )."'><button>".__('read more',maw)."</button></a>"; $btn.="</div>"; return $output . $btn; } else { return $output; } }
Note the ‘post’=== is to restrict it just to posts, this stops you accidentally adding read more to custom posts types (although you might want that all depending on your design )
by
Tags:
Leave a Reply