২৭ জুন, ২০২২

Auto Post Excerpt

How to add auto Post Excerpt on WordPress

Some of the free WordPress blogging themes don’t have the “read more” features for their homepage content. Using post excerpt from a blog post in WordPress is important for keeping your traffic. It also increases the page loading time which effects on bounce rate.

How a full content on Homepage increase page load time?

When you write a big content with full of resources and related images it generally increases page loading time. And when all of this kind of post appears on your homepage it increases the loading time more and more.

In that case, you can show a description of that post on your homepage and it will reduce the loading time.

How to add post excerpt to your WordPress theme?

Open your index.php, archive.php, category.php page.

You will find this page from your WordPress directory from the cPanel.

Now find this code

<?php the_content(); ?>

And replace it with

<?php the_excerpt(); ?>

this code.

Now use custom excerpts from your post page. And it will show post excerpts.

If you don’t use custom excerpt it will automatically excerpt first 55 words and will show on home page.

You can change this word limit also if you want. For this you need add this code to your function.php file.

// Changing excerpt length

function new_excerpt_length( $length ) {
return 100;
}

add_filter( 'excerpt_length' , 'new_excerpt_length' );

// Changing excerpt more
function new_excerpt_more( $more ) {

return '...' ;
}
add_filter( 'excerpt_more' , 'new_excerpt_more' );

There 100 is the word number

সার্চ করুন:

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
Domain Names
Email Tutorials
How to
Transfer Domain
Web Development
Web Services
Website Design
Wordpress
ডোমেইন
হোস্টিং

সাম্প্রতিক পোস্ট

Why Choose Deshi Hosting for…
How to add default featured…