MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

How do I add the "Read More" button to posts in Laurel?

Please note: This FAQ Article is specifically for the Laurel theme.



The "Continue Reading" link in Laurel is a wonderful tool-- It gives your site's visitors a taste of your posts as well as keeps your homepage tidy & more easily navigable instead of displaying 100% of every post.

Laurel gives you the option of either manually adding the "Continue Reading" link to each post, or, auto-applying the "Continue Reading" link to all posts with the click of a button.

Both options have pros & cons. We'll go over the differences between the two and how to enable either option below.




MANUALLY ADDING THE READ MORE BUTTON:

Please note: This option is for the Homepage/Archive Page/Blog Page layout option that displays the "Full Post Layout". The "Read More" button is auto-applied for the Grid and List Layouts. See further below for adjusting these layout options. 

Also known as the "Read More" tag or the "More" Gutenberg block, you can add the "Read More" button to a post within the post's "create/edit" screen. Some people prefer the customizability of this option as they can choose where within the post they'd like to place the button and just how much content of the post they'd like shown on the homepage.

The downside is that manually inserting the "Read More" tag can be a bit tedious as it needs to be inserted into each of your posts.

To add a "Read More" tag to your post, you can navigate to the post's create/edit screen. Click the " + " plus icon to insert a new Gutenberg content block where you'd like the "Read More" button to appear. Then, use the search bar function to search for the term "More". This will bring up the Gutenberg "More" block. Select this block. 



Clicking this icon will insert a dashed horizontal line with the words "READ MORE" centered within it. This is your "Read More Tag". WordPress will display all of the text above this "READ MORE" line, and will hide everything beneath it until the visitors clicks through to your singular post page.

Please also remember to navigate to WP Dashboard > Appearance > Customize > General Settings > Homepage/Archive Post Summary Type > and selected the "Use Read More Tag" option. 



AUTO-APPLYING THE READ MORE BUTTON:

Another option would be to have the theme automatically apply this "Read More" tag into all of your posts. This is a great option if your site already has a large number of posts that you'd rather not go through and manually apply the "Read More" tag to. Or, if you'd like the ease of simply not worrying about this extra step for all future posts.

One thing to note is that this method uses the WordPress"excerpt" function. This function will filter out any HTML code including images and hyperlinks inserted at the beginning of your post (not including the Featured Image), so your excerpt will only display static text, not pictures.

If it's important to you to have hyperlinked text or images within your post summary on the homepage/blog post page, you may want to consider the option above for manually inserting the "Read More" button.

To auto-apply the "Read More" tag to all of your posts, navigate to WP Dashboard >Appearance > Customize > General Settings > Homepage/Archive Post Summary Type > and choose the "Use Excerpt" option. 






CHANGING THE AUTO-APPLY WORD COUNT TO LENGTHEN/SHORTEN POST EXCERPTS:

If you use the option to auto-apply the "read more" tag to your posts, WordPress uses the "excerpt" function. WordPress determines where to place the "Read More" tag within your post based on how many words it counts through from the start of the post.

By default, Laurel's excerpt will count through a particular number of words before placing the "Read More" tag depending on which blog layout option you're using:

  • FULL POSTS: 26 words before the "Read More" button appears 
  • LIST POSTS: 18 words before the "Read More" button appears 
  • GRID POSTS: 15 words before the "Read More" button appears 

You can change the number of words by making a slight adjustment to the theme's related layout file. See the instructions for each layout option below.


TO CHANGE THE EXCERPT WORD LENGTH FOR STANDARD POSTS

Navigate to Appearance > Editor > and open up the file titled "content.php"
On Line 55, you will see this line of code:

<p><?php echo solopine_string_limit_words(get_the_excerpt(), 26); ?>…</p>


Do you notice the "26" number value in that code? This is the number of words the standard post layout's excerpt will display before automatically adding in the "Read More" button. 

You can change the "26" number value to whatever number you prefer.
Please save changes to the file when finished.



TO CHANGE THE EXCERPT WORD LENGTH FOR LIST LAYOUT POSTS

Navigate to Appearance > Editor > and open up the file titled "content-list.php"
On Line 24, you will see this line of code:

<p><?php echo solopine_string_limit_words(get_the_excerpt(), 18); ?>…</p>


Do you notice the "18" number value in that code? This is the number of words the list post layout's excerpt will display. 

You can change the "18" number value to whatever number you prefer.
Please save changes to the file when finished.



TO CHANGE THE EXCERPT WORD LENGTH FOR GRID LAYOUT POSTS

Navigate to Appearance > Editor > and open up the file titled "content-grid.php"
On Line 22, you will see this line of code:

<p><?php echo solopine_string_limit_words(get_the_excerpt(), 15); ?>…</p>


Do you notice the "15" number value in that code? This is the number of words the list post layout's excerpt will display. 

You can change the "15" number value to whatever number you prefer.
Please save changes to the file when finished.