Skip to content

Instantly share code, notes, and snippets.

@Deaner666
Last active November 16, 2016 22:34
Show Gist options
  • Select an option

  • Save Deaner666/c585c178032b0859bceb to your computer and use it in GitHub Desktop.

Select an option

Save Deaner666/c585c178032b0859bceb to your computer and use it in GitHub Desktop.

Revisions

  1. Deaner666 revised this gist Jul 22, 2015. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    // Add "Read More" link to hand-crafted excerpts
    add_filter('get_the_excerpt', 'wpm_manual_excerpt_read_more_link');
    function wpm_manual_excerpt_read_more_link($excerpt) {
    $excerpt_more = '';
    if( has_excerpt() ) {
    $excerpt_more = '&nbsp;<a href="' . get_permalink() . '">[Continue&nbsp;reading]</a>';
    }
    return $excerpt . $excerpt_more;
    $excerpt_more = '';
    if (has_excerpt() && ! is_attachment() && get_post_type() == 'post') {
    $excerpt_more = '&nbsp;<a href="' . get_permalink() . '">[Continue&nbsp;reading] <span class="screen-reader-text">' . get_the_title() . '</span></a>';
    }
    return $excerpt . $excerpt_more;
    }
  2. Deaner666 revised this gist Jan 20, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    <?php

    // Add "Read More" link to hand-crafted excerpts
    add_filter('get_the_excerpt', 'wpm_manual_excerpt_read_more_link');
    function wpm_manual_excerpt_read_more_link($excerpt) {
  3. Deaner666 created this gist Jan 20, 2015.
    9 changes: 9 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    // Add "Read More" link to hand-crafted excerpts
    add_filter('get_the_excerpt', 'wpm_manual_excerpt_read_more_link');
    function wpm_manual_excerpt_read_more_link($excerpt) {
    $excerpt_more = '';
    if( has_excerpt() ) {
    $excerpt_more = '&nbsp;<a href="' . get_permalink() . '">[Continue&nbsp;reading]</a>';
    }
    return $excerpt . $excerpt_more;
    }