Tag: Wordpress Excerpts

  • 2 Amazing Ways To Add Excerpts to Your Pages in WordPress

    Excerpts are crucial in providing a brief yet informative overview of your content. They are beneficial in adding a summary, description, or key details about a page.

    However, by default, they are only available for posts in WordPress.

    But don’t worry, we’ve got you covered!

    Here, we will show you how to add excerpts to your pages in WordPress quickly and confidently, following a step-by-step approach.

    Add Excerpts To Your Pages In WordPress

    Point to be Remember

    Enabling page excerpts in WordPress can be a bit tricky, as it requires adding custom code to your theme’s functions.php file.

    Any mistake in typing the code can result in your website breaking down. Also, if you switch to a new theme or update it, you will have to add the code all over again.

    1. Display Page Excerpts using Shortcode in WordPress

    Presently you have added the functionality to display that on your WordPress pages, let’s move ahead add excerpts to your pages in WordPress to display them on your website.

    You must add a WordPress excerpt shortcode to your widget area or page.

    For this, you need to install and activate the Display Posts plugin first.

    Once you install and activate the Display Posts plugin, you will be able to use a shortcode that displays ten recent pages along with their title, excerpt and a ‘continue reading’ link.

    If you haven’t specified a custom excerpt for a page, the plugin will automatically generate an excerpt with a default length of 55 characters.

    Procedure 1: Display Excerpts in Page using Shortcode

    After activating your WordPress site, you need to create a new page where you want to display a list of your pages along with the WordPress excerpt block.

    Then, click on the Add Block “+” button to open the block menu and select the ‘Shortcode‘ block.

    To add excerpts to your pages in WordPress, open it in the WordPress block editor.

    Once you have added an excerpt to your page or post, you can visit your WordPress site to view the list of page excerpts.

    Here, you can expand the tab and add WordPress excerpts for pages.

    Add shortcode block to wordpress page

    Then, paste the following shortcode into the block:

    				
    					[display-posts post_type="page" include_excerpt="true" excerpt_more="Continue Reading" excerpt_more_link="true"]
    				
    			

    After that, click the ‘Update‘ or ‘Publish‘ button to save your settings.

    To view the list of page excerpts, go to your WordPress site.

    in-block-theme-page-excerpt-preview

    Procedure 2: Display Excerpts in Sidebar using Shortcode

    To display page excerpts on your WordPress sidebar, follow these steps:

    Go to the Appearance > Widgets page from your WordPress dashboard.

    Click here to add widget to page

    Remember that: If you can’t see the ‘Widgets’ menu tab on your dashboard, you may be using a block theme. If so, skip to the next step.

    Once on the Widgets page, press the add block ‘+‘ button on the left to expand the block menu.

    Search for shortcode widget

    After that, add the Shortcode block to the sidebar area.

    If you’re using a block theme, you’ll need to copy and paste the following shortcode into the block to add excerpts to your pages in WordPress:

    				
    					[display-posts post_type="page" include_excerpt="true" excerpt_more="Continue Reading" excerpt_more_link="true"]
    				
    			

    After that, press the ‘Update‘ button to store your settings.

    Add PHP code to the shortcode widget

    Finally, go to your WordPress blog to view the page excerpts.

    2. Display Excerpts in Pages using WordPress Plugin

    Fortunately, there is a solution to this problem- the WPCode plugin. It is a WordPress code snippets plugin that can make adding custom code to your website easy and safe.

    To add excerpts to your pages in WordPress, you have to install and activate the WPCode plugin. You can follow a step-by-step procedure on installing WordPress plugins for detailed instructions.

    WPCode Plugin

    Remember that WPCode offers a free plan to add excerpts to your pages in WordPress, but upgrading to the pro version gives you access to a cloud library of code snippets, smart conditional logic, and CSS snippet options.

    Once you activate the plugin, you will find the ‘Code Snippets‘ option in your WordPress dashboard.

    Select the ‘Add Snippet‘ button to create a custom code snippet.

    add-new-snippet

    You can give it a name for identification purposes, but this name won’t be displayed on your website’s front end.

    Next, choose the ‘PHP Snippet‘ option from the dropdown menu.

    select-php-snippet-for-page-excerpts

    Add the custom code into the ‘Code Preview‘ box.

    				
    					add_post_type_support( 'page', 'excerpt' );
    				
    			

    After adding the custom code, scroll to the ‘Insertion‘ section and select the ‘Auto Insert‘ mode.

    select-auto-insert-method

    Once you activate the snippet, the custom code will automatically execute on your website.

    Go back to the top of the page and toggle the ‘Inactive’ switch to ‘Active.’

    Finally, press the ‘Save Snippet‘ button to store your settings.

    Save page excerpt snippet

    Don’t forget to click the ‘Update‘ or ‘Publish‘ button to save your changes.

    Repeat this to add excerpts to your pages in WordPress.

    in-block-editor-insert-page-excerpts

    Conclusion

    In this blog, we learned about two different methods to add excerpts to your pages in WordPress, manually or using a plugin.

    You can easily add an excerpt through these methods and make your website more user-friendly.

    In this blog post, we add an excerpt using the WPCode plugin.

    Here is a list of some more recommended plugins that you can use to add excerpts to your pages in WordPress