• I like the plugin, but I would like that the first item “all categories” was not there. It is very annoying that if you click on submit, all pages become visible.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi —

    Firstly, at the moment on your URL, each category shows a count of exactly 1 — which is suspicious, and wrong (e.g. “Wegenwacht” has zero). Secondly, if they’re all “1” you could/should hide these counts, using show_count=”0″.

    I think your solution (because you have a single dropdown) is to add empty_search_url=whatever (with some URL for this “whatever”, e.g. /zoekresultaat so you’re back at the empty search form). See one-before-last of https://docs.designsandcode.com/search-filter/#examples

    Because in general, a search page will have more of these things — your problem only appears if nothing is selected anywhere!

    Thread Starter Boertje

    (@boertje)

    Yes, now there are only a few categorys with more then one pages. But that’s because I’m now in the experimental phase. If I continue with the plugin I will also fill in the other pages.

    About “Wegenwacht”, I have to figure that out, but I thought that d plugin ensures that if there are no pages in the category, nothing is shown.

    But from your answer I understand that it is therefore not possible to replace “All categories” with for example “search”

    “But from your answer, …”: Ah, no, see the same page I linked, about the 7th line of the Options table.

    You can just add e.g. the parameter all_items_labels=”Zoeken” so your “Alle categorie?n” (which is just the default Dutch name for all_items parameter of Category) will turn into “Zoeken”.

    Thread Starter Boertje

    (@boertje)

    Thanks, a whole step further. But if someone clicks on this, so without having made a choice, everything will be shown but no categories, maybe the uncategorized? In an ugly page. But that is not what I want.

    About the “Ugly page”: The way it looks is decided by two separate but connected things,

    1// Your CSS styling (which looks OK — you might separate them visually a bit more (e.g., give each separate result a distinct background with body.search-result article {background-color: rgba(50,255,50,.2); padding: 1em 2em; padding-bottom:2em;}). So you can work with that if needed.

    2// Your (child?) theme’s templates, here probably the “category.php” template, or “archive.php” or more specific (you can test it, e.g. by adding a different nonsense class to the <body> in all the possible candidates, then look at the HTML output and see which nonsense class was used). Because at there you can choose whatever attribute of the results you want to show (now, title+excerpt) — the Featured Image, the post_date, the last_updated timestamp, its tags and categories, its rating or whatever custom taxonomy you’ve applied to it. And the order (by ID, by title, by post_date; ASCending or DESCending order; … ). And also the pagination settings!

    HOWEVER, I understood you didn’t want the results to appear at all — basically “make that first option inactive”. That’s why I suggested in my first post, if no selection is made then use that ‘nothing was selected’ option to link back to this search page itself — so the visitor feels nothing has happened (while actually it did, but the outcome is the same as they started from).

    But maybe I misunderstand and/or there’s a further issue?

    Thread Starter Boertje

    (@boertje)

    I had not understood in your first email that this had already been implemented. But it works exactly as I wanted. The plugin is now operational and is on the homepage. Thanksa lot!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘First item not undesirable’ is closed to new replies.