Strange search element result

When I query the search element I get, as one of the results an item titled “Home”. Here is a link to a screenshot. What is up with this?

Hi,

Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation.

Thank you.

Hi @ggoudey,

Not sure why it is showing like that. It would be best that we could check your site closer.

Please share us your admin credentials. Don’t forget to set it in a secure note.

You could add this CSS in your Pro > Theme Options > Custom CSS for temporary fix:

.search-results .post-1226{
    display:none;
}

Let us know how it goes.

Thanks.

Hi Nico

The problem seems to have removed itself…? I will re-post with more info, if it reoccurs.

The CSS you provided: if there are other posts I don’t want showing, how do I separate them in the code. Please give a mock example of two posts. Thank you.

Andrew

Hi @ggoudey,

You can use this example below as a guide for your two or more posts to be removed.

.search-results .post-1226,.search-results .post-1228, .search-results .post-1229{
    display:none;
} 

Hope it helps.

Let us know how it goes.

Thanks.

Hi Nico

Thank you. I will give it a try.

You’re welcome! :slight_smile:

Hi Nico

I tried your CSS in the Theme Options for two pages (not posts) that come up in the search. They are still showing. Enter the search term “eggs”, and at the bottom of the results you will see the pages “Submit” and Submit form",

Hello There,

The search results will display the excerpts. The excerpts were automatically generated from the very first 55 words of the contents by default. If in any case there is a shortcode or custom codes in the first few words in your content. It will be displayed in the excerpts. To resolve this issue, you will need to add manual excerpts to your post and pages. By default pages has no excerpts because it is disabled by WordPress. This is why you are only seeing page titles and no descriptions in it. You have to turn in on by inserting this following code in your child theme’s functions.php file

// Add manual excerpts to pages
// =============================================================================
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
     add_post_type_support( 'page', 'excerpt' );
}
// =============================================================================

The child theme is need and must be set up. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

To display the page excerpt, you may have to use the manual excerpts. To add an excerpt to a page, simply write one in the Excerpt field under the post edit box. Please see the screenshot below: http://prntscr.com/a57dbr

Excerpts are optional hand-crafted summaries of your content that can be used in your theme. Learn more about manual excerpts here: https://codex.wordpress.org/Excerpt

We would loved to know if this has work for you. Thank you.

Thank you RueNel. I will need to look into this.

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.