• Resolved snowme

    (@snowme)


    Hi,

    Is there a way to have WordPress Style Excerpts only on the Search Results page?

    I found the setting you have to switch from Raindrops Excerpt to WordPress Excerpt but it changes it for the entire site.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author nobita

    (@nobita)

    Hi snowme

    Dashboard / Appearance / Customize

    Excerpt / Search Result Entry Contents

    Set value ‘Show Excerpt’

    Wait a few seconds, the new setting item is displayed

    Excerpt Type

    WordPress Excerpt. standard excerpt

    HTML in Excerpt. contain html ( images,video ) excerpt

    Add More Link After Excerpt

    Yes. Add link button

    Excerpt Length

    Please change the favorite value while checking the preview

    Thank you

    Thread Starter snowme

    (@snowme)

    Hi nobita,

    It seems like every time I change it to WordPress Excerpt it also changes my Front page to WordPress Excerpt as well. I’d like to keep the Front Page as “HTML in Excerpt” and only change the Search Results page to “WordPress Excerpt” Is that possible?

    Theme Author nobita

    (@nobita)

    Create child theme

    example

    https://tenman.info/download/child-raindrops.zip

    Copy Raindrops / search.php

    change code

    <div class="entry-content clearfix">
    
                                            <?php
                                            raindrops_prepend_entry_content();
    
                                           // raindrops_entry_content();
    					the_excerpt();  //change above function                                      ?>
                                            <br class="clear" />
                                            <?php
                                            raindrops_append_entry_content();
                                            ?>
                                        </div>

    change from raindrops_entry_content() to the_excerpt();

    paste child theme / search.php

    child theme / functions.php

    add excerpt length for search rezults.

    function wpdocs_custom_excerpt_length( $length ) {
    	if( is_search() ) {
                 return 20;
    	}
    	return $length;
    }
    add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 );

    Thread Starter snowme

    (@snowme)

    Thanks again for the quick turnaround. Search results are now in WordPress format and Main page is still in HTML format.

    Theme Author nobita

    (@nobita)

    I’m not sure

    I’d like to keep the Front Page as “HTML in Excerpt”

    and

    only change the Search Results page to “WordPress Excerpt” Is that possible?

    Do I have an understanding that was wrong?

    Sorry poor english.

    Thread Starter snowme

    (@snowme)

    Sorry for confusing you. I meant to say it is working good. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress Excerpt on Search Results Page’ is closed to new replies.