Skip to content

How to properly use the More block in WordPress?

The “More” block in WordPress is a simple yet powerful tool that allows authors and editors to manage the display of content on blog pages. In this article, we will present several ways to use this tool, including specific solutions such as PHP snippets and plugins.

1. Basics of using the "More" block

The “More” block in WordPress is intuitive to use. To add a “More” block to a post:

  1. Go to the WordPress post editor.
  2. Click where you want to add a “More” block.
  3. Click on the “+” icon (add block) and search for the “More” block.
  4. Click on the “More” block to add it to the entry.

Now the content after the "More" block will be hidden on the home page or archive page, and visible only after clicking the "read more" link or opening the full entry page.

2. Customizing the “read more” link text

By default, the link text of the “More” block in WordPress is “read more.” However, we can customize this using the following PHP snippet:

function modify_read_more_link() { return &#039;<a class="more-link" href="/en/' . get_permalink() . '/">Your text here</a>&#039;; } add_filter( &#039;the_content_more_link&#039;, &#039;modify_read_more_link&#039; );

This code should be placed in the functions.php file in your WordPress theme. We change “Your text here” to your preferred link text.

3. Changing the position of the “More” block

Sometimes we want the “More” block to appear at a specific place, for example after 55 words. We can achieve this with a WordPress plugin called “Advanced Excerpt”. After installing this plugin, simply set the word limit in the plugin settings.

4. Hiding the "More" block on specific pages

If we want to hide the “More” block on specific pages, we can do so using the WordPress conditional tag. Below is an example PHP code that will hide the "More" block on the home page:

function hide_read_more_on_home( $more_link_element, $more_link_text ) { if( is_home() ) { return ''; } return $more_link_element; } add_filter( 'the_content_more_link', 'hide_read_more_on_home', 10, 2 );

This code should also be placed in the functions.php file.

To summarize, the “More” block in WordPress is a simple but powerful tool that allows you to control the display of your content. However, remember to always make changes to your code safely by creating backups and testing your changes on a staging site.

Check out the offer of 1500+ Premium WordPress plugins and themes!