Skip to content

Instantly share code, notes, and snippets.

@ginsterbusch
Last active March 26, 2016 19:13
Show Gist options
  • Save ginsterbusch/ac262f735dd90a993a4d to your computer and use it in GitHub Desktop.
Save ginsterbusch/ac262f735dd90a993a4d to your computer and use it in GitHub Desktop.
Ribosome Theme: Moves the read more-link (on the home / front page) to the entry footer (child-theme safe).
<?php
/**
* Snippets for the content.php file, which displays regular posts, including those on the front / home page.
* NOTE: This applies to Ribosome v1.3.2
*/
/**
* Line #87: Replace "the_excerpt()" with "echo get_the_excerpt()"
* Alternatively, search for </div><!-- .excerpt-wrapper --> and then go two lines up ;)
*/
?>
<?php echo get_the_excerpt(); ?>
<?php
/* Line #124: Insert the following snippet
* Alternatively, search for "</div><!-- .entry-meta-term -->" and move the cursor up two lines
* NOTE: You may replace $myReadmoreText with your own; see example below ;)
*/
?>
<?php
$myReadmoreText = __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'ribosome' );
// $myReadmoreText = 'Read more ...'; // alternative text; replace with your own ;)
?>
<?php if( !is_single() && !is_singular() ) : ?>
<span class="entry-meta-readmore">
<a href="<?php the_permalink(); ?>"><?php echo $myReadmoreText; ?></a>
</span>
<?php endif; ?>
<?php
/**
* Drop the following snippet into the functions.php of your child theme.
* NOTE: Because the ribosome "developers" .. didn't prepare their theme for child theme usage (as usual *eyerolls*), we have to rely on this nasty hack, instead of going for a proper function overwrite ...
*/
add_filter('excerpt_more', '_anti_ribosome_excerpt_more', 999 );
if( !function_exists( '_anti_ribosome_excerpt_more' ) ) :
function _anti_ribosome_excerpt_more($more) {
return ' ...';
}
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment