• Resolved Anonymous User 16226427

    (@anonymized-16226427)


    Hi there,

    I was wondering if it’s possible to edit a snippets of the internal search results for the pages?

    When I create post, I’m able to insert a custom snippet myslef, but for pages I cannot find that. When page appears in internal wordpress search results, it just takes first number of words and makes a snippet. Can I change that manualy for every page I want?

    https://funkyimg.com/i/2Teis.png Example of pages in search results with auto-generated snippets

    Thanks

    • This topic was modified 5 years, 7 months ago by Anonymous User 16226427.
    • This topic was modified 5 years, 7 months ago by Anonymous User 16226427.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Copy the oceanwp > partials > search folder into the child theme and edit it as per your need.

    For the pages, you need to add below code to the functions.php file of the child theme to enable the excerpt –

    add_post_type_support( 'page', 'excerpt' );

    OceanWP child theme – https://docs.oceanwp.org/article/90-sample-child-theme

    Thread Starter Anonymous User 16226427

    (@anonymized-16226427)

    Thanks, I was able to add excerpt option to pages.

    Can I remove “CONTINUE READING” from wordpress search snippets too?

    I will be using “Read more…” link inside the exceprt anyways.

    https://funkyimg.com/i/2TepH.png Example

    Thanks

    Thread Starter Anonymous User 16226427

    (@anonymized-16226427)

    Removed by editing oceanwp-child –> partials –> search –> readmore.php

    Added empty brackets to $text = esc_html__( '', 'oceanwp' );

    Thanks

    • This reply was modified 5 years, 7 months ago by Anonymous User 16226427.

    Glad to hear that you found a solution!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom snippet for pages in internal website search results?’ is closed to new replies.