Skip to content

How to properly use the More block in WordPress?

The WordPress “More” block is a simple yet powerful tool that allows authors and editors to manage the display of content on blog pages. In this article, we’ll show you several ways to use this tool, including specific solutions like 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 the "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, content after the "More" block will be hidden from the home page or archive page, and only visible when you click the "read more" link or open the full post page.

2. Customize 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 of your WordPress theme. Change the “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, all you need to do is 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 a sample 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.

In conclusion, the WordPress “More” block is a simple yet powerful tool that allows you to control how your content is displayed. However, remember to always make code changes safely by creating backups and testing your changes on a test site.

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