Skip to content

Instantly share code, notes, and snippets.

@graylaurenm
Created July 3, 2014 15:45
Show Gist options
  • Save graylaurenm/15e8c82496b88867447a to your computer and use it in GitHub Desktop.
Save graylaurenm/15e8c82496b88867447a to your computer and use it in GitHub Desktop.
<?php
/* add link at beginning of excerpt */
add_filter( 'genesis_entry_content' , 'lgd_clickable_open', 1 );
function lgd_clickable_open() {
if (is_home() || is_front_page() || is_archive() ) {
printf( '<a href="%s" alt="%s">', get_permalink(), the_title_attribute( 'echo=0' ) );
}
}
/* end link at end of excerpt */
add_filter( 'genesis_entry_content' , 'lgd_clickable_close', 11 );
function lgd_clickable_close() {
if (is_home() || is_front_page() || is_archive() ) {
printf( '</a>' );
}
}
/* These styles are specific to my theme. You will want to adjust them for your own theme: */
/* essentially remove any link styling from the text, but add it back to the excerpt's link. */
.home .entry-content a,
.archive .entry-content a {
color: #333;
text-decoration: none;
}
.home .entry-content .read-more,
.home .entry-content .more-link,
.archive .entry-content .read-more,
.archive .entry-content .more-link {
color: #aaa;
text-decoration: underline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment