Forum Replies Created

Viewing 5 replies - 61 through 65 (of 65 total)
  • Thread Starter semoliner

    (@semoliner)

    The solution to this was to add this to the functions.php file:

    add_action('wp', 'inital_call_back');
    
    function inital_call_back(){
    	if ( is_search() ) {
    		add_filter( 'the_excerpt', 'the_excerpt_more_link', 21 );
    	}
    
    }
    
    function new_excerpt_more($more) {
    	return '';
    	}
    	add_filter('excerpt_more', 'new_excerpt_more', 21 );
    	function the_excerpt_more_link( $excerpt ){
    	$post = get_post();
    	$excerpt .= '<p class="read-more"><a href="'. get_permalink($post->ID) . '">Read more ?</a></p>';
    	return $excerpt;
    	}
    Thread Starter semoliner

    (@semoliner)

    Actually… this has caused some issue with other pages (which do not use entrance animations).

    Eg.
    Go to the home page and enter “parents” as a search term
    You will get only one result
    Click on Read more>>
    You will see that the page formatting is disrupted

    Remove ?highlight=”parents” from the URL in the address bar and hit Enter, the page then reloads with the correct formatting.

    Thread Starter semoliner

    (@semoliner)

    Yes! Awesome – thank you so much ??

    Thread Starter semoliner

    (@semoliner)

    Thank you – no wonder I couldn’t get it to work ??
    I appreciate your help with this and will refer to Astra support.

    Thread Starter semoliner

    (@semoliner)

    Thanks for the quick response! While I can edit search.php, I really have no idea where to add that line (as I don’t understand the contents of search.php). I experimented by pasting in various places without success. Here is my standard Astra search.php, in case you are able to suggest where I need to paste it?

    <?php
    /**
     * The template for displaying search results pages.
     *
     * @link https://developer.www.ads-software.com/themes/basics/template-hierarchy/#search-result
     *
     * @package Astra
     * @since 1.0.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    get_header(); ?>
    
    <?php if ( astra_page_layout() == 'left-sidebar' ) : ?>
    
    	<?php get_sidebar(); ?>
    
    <?php endif ?>
    
    	<div id="primary" <?php astra_primary_class(); ?>>
    
    		<?php astra_primary_content_top(); ?>
    
    		<?php astra_archive_header(); ?>
    
    		<?php astra_content_loop(); ?>		
    
    		<?php astra_pagination(); ?>
    
    		<?php astra_primary_content_bottom(); ?>
    
    	</div><!-- #primary -->
    
    <?php if ( astra_page_layout() == 'right-sidebar' ) : ?>
    
    	<?php get_sidebar(); ?>
    
    <?php endif ?>
    
    <?php get_footer(); ?>
    
Viewing 5 replies - 61 through 65 (of 65 total)