Reply To: Override search results page

#6915
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi!

1. I just tried and it works on my end: https://i.imgur.com/uTi66iY.png
I disabled the resources and feeds post type filter, and the two posts are there in the results list. I didn’t uncheck the “Free Project Management Courses” and the “Articles” checkbox – it would exclude both of them, because one is in the first category, the other is in the second.

2. Might be possible actually. The plugin has a built in highlighter script, which could be used to highlight terms on the search page. Try putting this custom script code to the search.php file in your theme directory:


<script>
jQuery(function($) {
   aspjQuery("main").highlight(aspjQuery(".probox input.orig").val(), { element: 'span', className: 'highlighted', wordsOnly: 0 });
});
</script>

and also, you need some custom CSS for it:


span.highlighted {
    font-weight: bold;
    color: #d9312b;
    background-color: #eee;
    background-color: rgba(253, 181, 48, 0.57);
}

I’m just guessing here, this might not work though.

3. I guess those pages have either some kind of shortcodes as content or custom code or maybe they are just a permalink for a theme file. The plugin tries to get any content possible. However for example the “Blog Articles” page does not actually have any content, it’s only a permalink to redirect to a theme file. It basically orders wordpress to show something on that permalink. I don’t think it’s possible to show any kind of content on these pages within the search results.

4. As I can see your current theme already does that for you, you only need the custom styling CSS code. Every article element on the results page is marked with a CSS class based on the post type. I can see these:

    type-post
    type-page
    type-feed

so you can easily make custom CSS to distinguish each type like. For example to change some styles only on “post” results:


article.type-post {
    /* generic custom CSS code */
}

article.type-post p {
    /* paragraph, post content custom CSS code */
}

article.type-post h1,
article.type-post h1 a {
    /* post title custom CSS code */
}
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)