Site logo

[Resolved] Adding Search to Home page menu using Relevanssi

Home Forums Support [Resolved] Adding Search to Home page menu using Relevanssi

Home Forums Support Adding Search to Home page menu using Relevanssi

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1899547
    Larry

    I’m guessing this is simple, but cannot figure it out. I’m just trying to add the word “Search” to my main menu, connected to the Relevanssi search engine plugin. Maybe it’s not compatible with Generate Press?? Relevanssi offers “searchform.php” and just “searchform” as a shortcode, but I have no idea where to use those.

    I am open to using a Generate Press search function if that is hiding somewhere in my Premium installation and just needs to be made visible.

    What can you suggest? It might also be useful to be able to place the word “Search” and/or the magnifying glass icon in other locations of the site, such as the footer.

    My site if it’s useful to take a look: http://www.universalethics.com

    #1899584
    Elvin
    Staff
    Customer Support

    Hi Larry,

    Can you specify which part of the main menu do you want to add the word “Search” on? Is it as a placeholder text? or simply a word beside the search icon?

    Also, will it be applied on specific page only (like Search Results)?

    #1900414
    Larry

    Thanks for a quick reply, Elvin. Something came up last night and I won’t be able to respond quickly for the next few days, so please be patient.

    Re. your questions: It doesn’t matter if there’s an icon or not, but would like the word Search somewhere in the Main Menu that when clicked, opens up a Search dropdown box rather than covering up all the other menu items, which it does now. If the word appears beside the icon, that’s ideal, but they both have to do the same thing, i.e., open a dropdown to enter the Search terms.

    My understanding is that the Main Menu applies to all pages.

    Re. your wise man quote – I assume this refers to browser cache, and not to some other type of cache somewhere.

    #1900461
    David
    Staff
    Customer Support

    Hi there,

    this CSS will move the open search form below the navigation and add a border to it:

    .navigation-search.nav-search-active {
        top: 100%;
        border: 1px solid #000;
    }

    You can change the forms background and text colors in Customizer > Colors > Primary Navigation.

    And if you want to add a Placeholder in the form, this article explains:

    https://docs.generatepress.com/article/generate_navigation_search_output/#add-a-placeholder

    Does that help ?

    #1905693
    Larry

    Sorry for the delay. Yes, that CSS worked perfectly. Thank you!

    A minor item, but if there’s also an easy way for me to add the word Search alongside the icon, please let me know.

    #1905739
    Ying
    Staff
    Customer Support

    Hi Larry,

    Try this CSS:

    /*desktop*/
    li.search-item.menu-item-align-right a:after {
        content: "Search";
        padding-left: 10px;
    }
    /*mobile*/
    .mobile-bar-items .search-item a:after {
        content: "Search";
        padding-left: 10px;
    }

    If you want the text to be in front of the icon, change afterto before,padding-left to padding-right.

    Let me know if you need further assistance 🙂

    #1905752
    Larry

    Thanks! I like the way it looks on mobile to balance the Menu!

    #1905797
    Ying
    Staff
    Customer Support

    You are welcome 🙂

    #1906995
    Larry

    Just some feedback, David. I noticed this morning that your solution works well on all of the pages except the Home page. For some reason, there has been no change on the Home page to the original setting, i.e., the search box has no border and whites out the Main Menu.

    I can live with this, but if there’s a way to fix it so that the Home page main menu works like every other page/post, please let me know.

    #1907429
    Elvin
    Staff
    Customer Support

    Can you try disabling the caching plugin and see if it works on all pages? It seems to be a caching issue w/ autoptimize.

    Let us know. 😀

    #1907510
    Larry

    1. Yes – that was exactly the problem. Thanks for the quick fix! Now I understand what the wise man said – I thought he was referring to the browser cache.

    2. Re. Autoptimize Settings, would you caution or recommend using their Optimize Images and/or Lazy-load images?
    (ShortPixel claims they can compress all 10 Homepage images to less than half the size, ie. by 53%)

    #1907513
    Larry

    One more thing – Autoptimize is telling me this, and I wonder if I need to do something to get better loading speed:

    “It looks like your site might not have page caching which is a must-have for performance. If you are sure you have a page cache, you can close this notice, but when in doubt check with your host if they offer this or install a page caching plugin like for example WP Super Cache, KeyCDN Cache Enabler,…”

    Is that relevant to Generate Press?

    #1907529
    Elvin
    Staff
    Customer Support

    for #2:

    It depends. You should avoid having lazy load on image if it appears above the fold as this can cause CLS.

    One more thing – Autoptimize is telling me this, and I wonder if I need to do something to get better loading speed:

    “It looks like your site might not have page caching which is a must-have for performance. If you are sure you have a page cache, you can close this notice, but when in doubt check with your host if they offer this or install a page caching plugin like for example WP Super Cache, KeyCDN Cache Enabler,…”

    Is that relevant to Generate Press?

    You should have autoptimize’s caching + modification enabled. Just make sure it’s purged so the CSS being served is the updated one. 😀

    #1908196
    Larry

    Re. your final comment, I cannot find the word “modification” anywhere within the Autoptimize Settings. Did I miss it somewhere, or is there another word for this?

    #1908586
    Elvin
    Staff
    Customer Support

    Ah sorry, I meant “minification” or “minify”.

    But that’s minor. The most important thing is to always purge your cache when you change anything on the site.

    And make sure you purge all cache. Some sites have a server-side cache(page cache) which is different from your plugin’s cache.

    There’s also CDN cache if you’re using one.

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