How to Display "Read More" Links on DIVI Search and Tag Pages

2018-09-18 127 words 1 min read

The Divi template is great, but his founder may also have a philosophy of "don't make the most of it." In some places, I suspect that it is a flaw that he deliberately left behind.

For example, his search and tag pages, why not make a read more links by default.

Go to their forum to find a solution.

Find the index.php file in the divi directory and find 54 lines, change to:

 
truncate_post( 270 );
printf( ' <a href="%1$s" class="more-link" >%2$s</a>' , esc_url( get_permalink() ), esc_html__( 'read more', 'et_builder' ) );

Then upload it to the sub-template directory of divi:
scp \path\index.php yourusername@yourwebsite.com:/home/yourusername
ssh yourusername@yourwebsite.com

sudo mv index.php /var/www/yourwebsite.com/wp-content/themes/divi-child/

Get it, now the search results and tag page also have a "read more" link.

 


Tags: divi wordpress

author

Authored By Jesse Lau

A freelancer living in New Zealand, engaged in website development and program trading. Ever won 1st ranking twice in the Dukascopy Strategy Contest. This article is licensed under a Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now

Post Your Comments Here:

Our website uses cookies to improve your user experience. If you continue browsing, we assume that you consent to our use of cookies. More information can be found in our privacy policy Got it