Hide author from search results

7 Commentaires

  • Jessie Schutz
    Actions pour les commentaires Permalien

    Thanks for the tip, Andrea!

    0
  • Scott
    Actions pour les commentaires Permalien

    Hello, what if I want to remove that entire line, including the date it was last written and its location?

    0
  • Andrey
    Actions pour les commentaires Permalien

    Hi Scott,

    You can simply add the following line to your CSS:

    .search-result-meta { display: none; }

    0
  • Dana Goddard
    Actions pour les commentaires Permalien

    I am not sure where to add these things. Between which lines or elements? I have tried pasting this code in several locations and hitting Preview, but it doesn't cause the author's name to disappear.

    0
  • Andrea Villa
    Actions pour les commentaires Permalien

    Hi,

    is this js code still vaild after 5 years ?

    Is it possible to know right position of css line to remove all content ?

     

    Thanks a lot !

     

    Cheers

    0
  • jay darado
    Actions pour les commentaires Permalien

    Hey Andrea Villa

    Can you please elaborate on which thing you want to hide on the search result template, so that I will provide you exact solution to your problem.

    Thanks 

    Jay 

    0
  • Karen Snyder
    Actions pour les commentaires Permalien

    Andrea Villa

    [Note that this comment is valid only if your theme uses unified search results, meaning that your search results have a column on the left where you can specify whether you want to search all types, articles, or the community.]

    If you want to hide the author's name, you can add the following code to style.css:

    .search-result-meta-name {
    display:none;
    }

    However, since the author's name is followed by a bullet and the date, you probably also want to remove the bullet and padding from before the date. To do this, you need to locate the lines in style.css that reference .search-result-meta-time::before and contain content: "\2022" and padding-left. They should look like the following, although they might not be an exact match: 

    .search-result-meta-time::before, .search-result-meta-count::before {
    display: inline-block;
    content: "\2022";
    speak: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    }

    [dir="rtl"] .search-result-meta-time::before, [dir="rtl"] .search-result-meta-count::before {
    padding-left: .3125rem; /* 5px */
    }

    You then need to remove .search-result-meta-time::before from the lines so that they look like this:

    .search-result-meta-count::before {
    display: inline-block;
    content: "\2022";
    speak: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    }

    [dir="rtl"] .search-result-meta-count::before {
    padding-left: .3125rem; /* 5px */
    }

    Please let me know if you have any questions.

     

    0

Vous devez vous connecter pour laisser un commentaire.

Réalisé par Zendesk