Fixing the Missing 'Read More' Button Issue in the GeneratePress Theme

When using the GeneratePress theme for WordPress, the "Read More" text is displayed by default, and in the paid version, there is an option to display the "Read More" as a button and change its text. However, there may be cases where the "Read More" text or button does not appear. Let's take a look at what to check if the "Read More" is not displayed.

How to fix the Missing 'Read More' Button Issue in the GeneratePress Theme

If you are using the GeneratePress Premium version, under Appearance » Customize » Layout » Blog in the Archives tab, there is an option to specify the Read more label and an option to display the Read More text as a button (Display read more as button).

Display read more as button in WordPress GeneratePress theme

However, there may be instances where the "Read More" text or button does not appear in some or all posts. This issue can occur in both the free and premium versions of the theme.

Fixing the Missing 'Read More' Button Issue in the GeneratePress Theme

Cause of the Issue

The cause of this issue is related to the specification of excerpts. When an excerpt is specified on the post editing screen, the "Read More" button does not appear on that post.

Solution 1 - Deleting the Excerpt

By default, if an excerpt is entered in the excerpt box on the post editing screen, the Read More button will not be displayed. Therefore, deleting the excerpt from the post will cause the Read More button to appear. If there are only a few posts with this issue, you can delete the excerpts manually.

Solution 2 - Adding Code to the Theme's Function File

Another solution is to add the following code to the theme's functions file (create and write in a child theme), and then the Read More text or button will be displayed.

add_filter( 'wp_trim_excerpt', 'custom_excerpt_read_more_link' );
function custom_excerpt_read_more_link( $excerpt ) {
    $output = $excerpt;

    if ( has_excerpt() ) {
        $output = sprintf( '%1$s <p class="read-more-button-container"><a class="button" href="%2$s">%3$s</a></p>',
            $excerpt,
            get_permalink(),
            __( 'Read more', 'generatepress' )
        );
    }
	
    return $output;
}

Solution 3 - Bulk Deleting Excerpts in the Database

If excerpts are only entered in a few posts, removing the excerpts from those posts will solve the problem. However, the situation is different if excerpts are inserted in all or many posts. If there are a large number of posts, it could take a significant amount of time to delete the excerpts from each post individually.

In such cases, you can consider bulk deleting the excerpts in the database (DB).

Before proceeding with this task, it is imperative to back up your DB. DB operations can be irreversible if something goes wrong. You can use plugins like UpdraftPlus for backup.

If you are using web hosting that provides cPanel, such as FastComet, you can log in to phpMyAdmin from cPanel to access your DB.

For those using Cloudways, phpMyAdmin is not provided, but a proprietary Database Manager tool is available. You can access the DB by clicking the Launch Database Manager button in the application.

Once you have accessed the DB, executing the following query will delete excerpts from all posts.

UPDATE WP_POSTS SET post_excerpt = ''; 

Please appropriately change the DB table prefix according to the environment you are using.

See Also...