[Support request] Search Results Page

Home Forums Support [Support request] Search Results Page

Home Forums Support Search Results Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1533932
    Alan

    For my staging site, I want to control the output of the search results page. This is a combination of blog posts, pages, and a custom post type (tours). In the search results page example shown, https://savacaystage.wpengine.com/?s=quito, I just want the titles shown, without the author name, duration, or except. So for example, the titles would be only “Ten Things To Do In Quito, Ecuador”, “Quito and 7 Day Santa Cruz II Cruise – Eastern Galapagos Islands”, etc.

    How can I do this in GP/GP Premium?

    Please let me know.

    Thanks,

    #1533943
    Elvin
    Staff
    Customer Support

    Hi,

    To clarify: You want the entry-meta items removed on search results but keep in archive pages?

    #1533974
    Alan

    Yes, I only want the entry-meta items removed from the search page.

    #1533980
    Elvin
    Staff
    Customer Support

    Try this PHP snippet:

    add_action( 'wp', function() {
        if ( is_search() ) {
            remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
            remove_action( 'generate_after_entry_title', 'generate_post_meta' );
        }
    } );

    Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/

    #1533995
    Alan

    That removed the byline. I also want to remove the “tour-meta”, which is “10 Days/9 Nights from $6,019”, and the “tour-meta” paragraph, which is “Venture to Quito and the eastern Galapagos Islands on this fascinating Ecuador tour. In Quito, you will enjoy a city tour and visit to the…”

    Thanks,

    #1534003
    Elvin
    Staff
    Customer Support

    Try this CSS:

    body.search .entry-summary {
        display: none;
    }
    #1534020
    Alan

    That worked. Thank you.

    #1534043
    Elvin
    Staff
    Customer Support

    That worked. Thank you.

    No problem. Glad to be of any help. 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.