Discover, analyze, get recomendations and fix Basic Technical SEO Issues now with 25+ tools and reports from the SEO Book Pro Beta Technical SEO and Website Audit Dashboard.
View All Dashboard Beta ToolsSEO Book Pro Nightly Alpha Documentation
Documentation
View the Full DocumentationSEO Book Pro - Server Database Status
Subscribe
"Welcome to our community! By subscribing, you'll gain access to exclusive content, helpful tips, and the latest updates on all SEO related topics. Plus, you'll be the first to know about any special offers or promotions we have in store. Join our growing community of technical SEO, Webmasters, Web Developers and Marketing Specialists and stay ahead of the game. Don't miss out - subscribe now!"
Follow us on social media:
FREE Basic SEO Audit
Basic Free Site Audit and Analyze Website for Technical and SEO Errors
Recent Posts ( 123 )
Dashboard Documentation ( 36 files )
- Introduction
- Audit Dashboard
- Main Dashboard
- Structured Data
- Your website on Google
- How Google Works
- SEO starter guide
- Guidelines
- Do you need an SEO?
- Maintaining your site
- Developer's guide
- Sitemaps
- robots.txt
- Meta tags
- Crawler management
- Removals
- Canonical URLs
- Site moves
- Redirects
- JavaScript SEO
- Multilingual sites
- Title links
- Snippets
- Images
- Videos
- Structured data
- Business details
- Favicons
- Publication dates
- Search Appearance
- Page experience
- Navigation structures
- Pagination loading
- HTTPS
- Mobile-friendliness
- Interstitials and dialogs
- View all SEO Topics
Latest Brand and Domains Audits ( 44 )
Technical SEO And Websites Audit ( 3 Guides)
SEO Book Pro Beta v/h
Technical SEO And Websites Audit Dashboard
SEO Book Pro is a suite of SEO tools that helps website owners and digital marketers optimize their websites for search engines. The tool provides features like keyword research, on-page optimization, link analysis, and site ranking reports, among others. SEO Book Pro is aimed at both experienced SEO professionals as well as beginners who are just starting out with search engine optimization.
Latest is_archivesBlank WordPress Theme
×Blank WordPress Theme Custom WordPress Business SEO Framework. This is Beta 1.98 Version. Crafted for Business and Business Services Types with all Specific Layouts and Valid Ranking Factors Needs for the Company to Present their Business Services online proper way with easy setup and managment options. Blank WordPress Theme is Custom WordPress and SEO Friendly WordPress Custom Template. The Layouts are Automated and Responsive Design based on the Device Types. The Theme is under development and not all features may work proper.
Custom WordPress Function the_excerpt() How to display a limited excerpt of a post in WordPress
Learn How and Why to use the_excerpt() WordPress custom function
Custom function to add in your WordPress Template functions.php file to limit the the_excerpt for your WordPress Loops for posts on the site. To display a limited excerpt of a post in WordPress, you can use the the_excerpt() function with a custom filter to limit the number of words displayed.
function custom_excerpt_length( $length ) { return 20; // Change the number to the desired length in words }
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
// Use the_excerpt() function to display the limited excerpt the_excerpt();
Why to display a limited excerpt of a post in WordPress?
Displaying a limited excerpt of a post in WordPress can provide several benefits for both the site visitors and the site owner. Here are some reasons why you might want to limit the length of the post excerpt: Improved readability: Long blocks of text can be intimidating for site visitors and make it more difficult to scan for information. By limiting the length of the excerpt, you can help improve the readability of your content and make it easier for visitors to find the information they need. Increased engagement: By providing a shorter, more focused excerpt of your content, you may entice readers to click through to the full post and read more. This can increase engagement with your content and help build a loyal readership. Better SEO: Search engines like Google use the content of your post to determine its relevance and rank in search results. By providing a clear, concise excerpt that accurately summarizes your content, you can help search engines understand the focus of your post and improve its ranking in search results. Overall, displaying a limited excerpt of a post in WordPress can help improve the user experience, increase engagement, and improve the search engine visibility of your content.Where to add the custom_excerpt_length() function in to my WordPress?
Option 1
You can add the custom_excerpt_lenght() function to limit the excerpt length in WordPress Posts in the functions.php file of your WordPress theme To add the function to your theme’s functions.php file, follow these steps:- Log in to your WordPress dashboard and
- navigate to Appearance > Theme Editor
- Select the functions.php file from the list of theme files on the right-hand side of the screen.
- Copy and paste the custom function code at the end of the file
- Save the changes to the functions.php file
Option 2
Alternatively, you can create a custom WordPress Plugin and add the function to the plugin file. Here’s how to do it in 3 simple steps:- Go to your FTP and find the /wp-plugins/ folder
- Create a new file and name it custom-excerpt.php.
- Copy and paste the custom function code below into the custom-excerpt.php file.
- Save the file and upload it to your WordPress site’s wp-content/plugins/ directory.
- Log in to your WordPress dashboard and activate the plugin under the Plugins menu.
/*
Plugin Name: Your Custom Plugin Name
Plugin URI: http://yourpluginurl.com/
Description: Write Short Informative Description for your Custom WordPress function to limit the excerpt length
Version: 1.0
Author: Your Name
Author URI: http://yourwebsite.com/
*/
Once you’ve added the function to your theme’s functions.php file or to a custom plugin, you can use the the_excerpt() function to display the limited excerpt in your post or page template
How to display the the_excerpt() custom function in my single.php, page.php or in to my post loops
To display the custom excerpt function in your
single.php
and page.php
template files, you can use the the_excerpt()
function as follows:
<?php the_excerpt();?>
To display the custom excerpt in your post loops, you can use the get_the_excerpt() function instead of the_excerpt(). This function retrieves the excerpt for the current post, without actually displaying it. Here’s an example of how you can use it in your post loop:
<?php while (have_posts()) : the_post(); ?>
<div class="entry-summary">
<?php echo wp_trim_words( get_the_excerpt(), 20, '...' ); ?>
</div>
<?php endwhile; ?>
In this example, we’re using the wp_trim_words() function to trim the excerpt to a maximum of 20 words and append an ellipsis at the end. You can adjust the number of words to match your desired length. Note that the get_the_excerpt() function does not automatically apply the custom excerpt length you set in the function, so you’ll need to use another method to limit the length of the excerpt if you want to use the custom length in your post loops.