• I’m not able to reduce the space between the header and “Risultati della ricerca:” (search results), and put a space between pagination links ( Pagina 1 di 5) and what stays below- thanks

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @sacconi,

    Hope you’re doing well.

    To make changes to how things look on your website, you can try using the following code:

    /* This code removes space above a main title */
    h1.page-title {
        padding-top: 0;
    }
    
    /* This code adjusts the space below pagination */
    .wp-pagenavi {
        padding-bottom: 20px;
    }

    Remember, after you make these changes in the code, you might need to do a “hard refresh” by pressing Ctrl+F5 or Cmd-Shift-R on your browser to see the updated appearance. This is because browsers usually store the old style information, and a hard refresh helps to load the new changes.

    Here’s another tip: Because you have 2 pagination on both top and down, it’s a good idea to give each of them a special name (an “id”). This way, you can adjust the look of one without affecting the other. This can be really helpful when you’re making changes.

    Hope this helps.

    Thread Starter sacconi

    (@sacconi)

    Search results pages and archive pages have a different layout, I cant use a “generalist” css

    Moderator bcworkz

    (@bcworkz)

    If you need different CSS on different pages, you need some way to distinguish one from the other with CSS selectors. We usually do this through various body tag classes. Typical classes might be “search” or “archive” based on what query properties are set. It doesn’t necessarily need to be the body tag, but some element that contains the content you wish to style differently.

    Your current body classes are:
    home blog wp-custom-logo hfeed mob-menu-slideout-over
    I don’t see anything useful here, but they are a little suspect. A search results page wouldn’t normally have home or blog classes. Doing so is not technically wrong, but it could make applying styles to specific pages more difficult.

    Your theme uses body_class() to output these class attributes. The attribute values can be altered through the “body_class” filter.

    Distinguishing search and archive pages is compounded because we’ve altered the default search to make a custom search. Assuming the custom search code I suggested earlier is still in place, search results are really just archive pages. Then how is it search results have “Risultati della ricerca:” but archive pages do not? Whatever that is, perhaps it can be leveraged to distinguish between the two for CSS purposes as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘css’ is closed to new replies.