Get WPFTS Pro today with 25% discount!

[Solved] EduMall theme does not show Smart Excerpts and broken the search results page


  • The famous and beautiful EduMall theme for WordPress has a little incompatibility with the WPFTS's Smart Excerpt. The reason for this is simple - the authors of this theme use their own way of shortening article text to generate excerpts and do not offer a workaround method within the code using hooks.

    Well, we'll have to use a tougher method to fix this incompatibility than simply installing an addon (as we do in most other cases).

    So, first of all, we have to switch to the child theme EduMall Child Theme. Technically, we could make fixes in the main theme as well, but in this case any update of the theme would result in the loss of all changes, and we don't need that.

    So, go to the child theme folder, edumall-child, and create a subfolder tree there:

    template-parts/blog/loop/

    Then go to the same folder in the main theme, find files excerpt.php and excerpt-long.php and copy only these two files to the new created folder in the child theme.

    Now we need to "patch" both files.

    Open the first file, excerpt.php, find two calls of the method Edumall_Templates::excerpt and comment it out with parameters, using /* */ operator.

    Then add this line below the "*/":

    the_excerpt();

    Do this in both places in this file.

    When done, move to the second file excerpt-long.php and do exactly the same in it, patch in two places.

    Finally your files should look like this:

    excerpt.php:

    <?php
    /**
     * The template for displaying loop excerpt.
     *
     * @link    https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
     *
     * @package Edumall
     * @since   1.0
     */
    
    defined( 'ABSPATH' ) || exit;
    
    $post_title = get_the_title();
    ?>
    <div class="post-excerpt">
    	<?php if ( empty( $post_title ) ) : ?>
    		<a href="<?php the_permalink(); ?>">
    			<?php /*Edumall_Templates::excerpt( array(
    				'limit' => 11,
    				'type'  => 'word',
    			) );*/ 
    			the_excerpt(); ?>
    		</a>
    	<?php else: ?>
    		<?php /*Edumall_Templates::excerpt( array(
    			'limit' => 11,
    			'type'  => 'word',
    		) );*/ 
    		the_excerpt();	?>
    	<?php endif; ?>
    </div>
    

    and excerpt-long.php:

    <?php
    /**
     * The template for displaying loop excerpt.
     *
     * @link    https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
     *
     * @package Edumall
     * @since   1.0
     */
    
    defined( 'ABSPATH' ) || exit;
    
    $post_title = get_the_title();
    ?>
    <div class="post-excerpt">
    	<?php if ( empty( $post_title ) ) : ?>
    		<a href="<?php the_permalink(); ?>">
    			<?php /*Edumall_Templates::excerpt( array(
    				'limit' => 42,
    				'type'  => 'word',
    			) );*/
    			the_excerpt(); ?>
    		</a>
    	<?php else: ?>
    		<?php /*Edumall_Templates::excerpt( array(
    			'limit' => 42,
    			'type'  => 'word',
    		) );*/
    		the_excerpt(); ?>
    	<?php endif; ?>
    </div> 
    

    All Done.

    After this, the useful Smart Excerpt of WPFTS should be visible on the Search Results pages.

    If it does not work - please let us know!

Suggested Topics

Be the first to read the news!

We are always improving our products, adding new functions and fixes. Subscribe now to be the first to get the updates and stay informed about our sales! We are not spammy. Seriously.

Join Us Now!

We are a professional IT-team. Many of us have been working in a Web IT field for more than 10 years. Our advanced experience of software development has been employed in the creation of the WordPress FullText Search plugin. All solutions implemented into the plugin have been used for 5 or more years in over 60 different web-projects.

We are looking forward to your comments, requests and suggestions in relation to the current plugin and future updates.

ewm-logo-450

The forum powered by NodeBB | Contributors