How to Add a Read More Link when Session Content is Too Long

  1. Home
  2. Docs
  3. Event Manager
  4. Frequently Asked Question...
  5. How to Add a Read More Link when Session Content is Too Long

How to Add a Read More Link when Session Content is Too Long

1. Backup the original files before making any changes.

2. Navigate to Appearance>>Editor and open the Schedule Page Template (template-schedule.php)

3. Look for the line (near line 80)

$content = get_the_content();

4. Add the following lines after the above line

$length = 20;
$shortened = implode(‘ ‘,array_slice(str_word_count($content,1),0,$length));
$content = $shortened.’…<br><a href=”‘ . get_permalink() . ‘”>Read more</a>’;

Here 20 is the number of words to show, you can change it to whatever number of words that you want.

5. Update the file

Was this article helpful to you? Yes No