Advertisement
Guest User

Untitled

a guest
Feb 26th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. if( !function_exists('startuply_excerpt_read_more_link') ) {
  2.     /**
  3.      * Add 'Read More' link to posts
  4.      *
  5.      * @param string $output Excerpt content
  6.      *
  7.      * @return string Excerpt content with added 'read more' link
  8.      */
  9.     function startuply_excerpt_read_more_link($output) {
  10.         global $post;
  11.  
  12.         // Is read more enabled in settings?
  13.         $show_read_more = startuply_option('blog_readmr', true);
  14.  
  15.         if ( $show_read_more ){
  16.             $output = $output . ' <a href="' . get_permalink($post->ID) . '" class="more-link" title="' . __( 'Read more', 'vivaco' ) . '">' . __( 'Read more', 'vivaco' ) . '</a>';
  17.         }
  18.  
  19.         return $output;
  20.     }
  21.  
  22.     add_filter( 'the_excerpt', 'startuply_excerpt_read_more_link' );
  23. }
  24.  
  25. if( !function_exists('startuply_modify_read_more_link') ) {
  26.     /**
  27.      * Modifying Read More links
  28.      *
  29.      * @return string Modified 'read more' link
  30.      */
  31.     function startuply_modify_read_more_link() {
  32.         global $post;
  33.        
  34.         return ' <a href="' . get_permalink($post->ID) . '" class="more-link" title="' . __( 'Read more', 'vivaco' ) . '">' . __( 'Read more', 'vivaco' ) . '<i class="fa fa-angle-right"></i></a>';
  35.     }
  36.  
  37.     add_filter( 'the_content_more_link', 'startuply_modify_read_more_link' );
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement