How to modify the excerpt or read more link of your template

If you want to modify the excerpt or the read more link you have 3 different ways to do it:

1. Loop Designer Options
You can define the visibility of your content and read more link in your loop template options.

2. Modify via Filter
You can modify the content and read more link with filtersFilter for the excerpt:
tk_loop_designer_the_excerpt Filter for the read more link:tk_loop_designer_read_more_link

Example function to use filters to manipulate the read more linkJust copy the following line to your functions.php and modify to your needs!

add_filter('tk_loop_designer_read_more_link','change_my_read_more_link');

function change_my_read_more_link($read_more){

echo'some content'; }


3. Remove completely and add your own

You can deregister the complete function from the loop_designer and build your own.

Remove the Content and read more link with this remove_action hook:

remove_action('tk_loop_designer_after_loop_title','tk_loop_designer_list_posts_content', 20 );


Let us look at how the function is responsiable for the entry excerpt and read more link:

function tk_loop_designer_list_posts_content(){

global $list_post_atts, $post;

// Extract the arguments

if($list_post_atts){

extract($list_post_atts);

}

// check if the excerpt should be displayed

if($show_the_excerpt =='on')

echo apply_filters('tk_loop_designer_the_excerpt','<p>'. get_the_excerpt() .'</p>');

// check if the read more link should be displayed

 if($show_more_link =='on') {

    if( $clickable =='on'){

echo apply_filters('tk_loop_designer_read_more_link','<p><span>'. __('read more','x2') .'</span></p>');

} else { 

echo apply_filters('tk_loop_designer_read_more_link','<p><a href="<?php the_permalink() ?>" target="<?php echo $link_target; ?>">'. __('read more','x2') .'</a></p>');

}

}

}

Tip! If you want to rename the read more link to something else, you can do this also easily by changing the language files.


Please see this Plugin which makes the whole translation process very easy 
http://wordpress.org/plugins/codestyling-localization/

Still need help? Contact Us Contact Us