Skip Navigation

[Resolved] Search box

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 24 replies, has 2 voices.

Last updated by Waqar 4 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1705117

Hi,

Thanks for asking! I'd be happy to help.

> Sorry but where do I create this custom field? Under Toolset --> Custom Fields ---> Post type?

- To add a custom field, you'll go to WP Admin -> Toolset -> Custom Fields.
( ref: https://toolset.com/course-lesson/creating-custom-fields/ )

Under the "Post Fields", you can include a new custom field group and name it something like "Search settings", making it available for all post types, which are included in the view used for this custom search.
( screenshot: hidden link )

The rest of the instructions to add a custom field in this field group are the same as the last message.

regards,
Waqar

#1705217
Skærmbillede 2020-07-13 kl. 15.15.37.png
Skærmbillede 2020-07-13 kl. 15.15.31.png

Hi Waqar,

Okay so I went into Toolset --> Custom Fields --> Create new group which I called "Search Setting".

Now, what field do I need to insert there? I'm not sure I quite follow your last message. I understand what to do in the search form but not the custom field build. I'm very sorry.

#1705267

Okay, I found the "select" modul now and put it in. But how do I give the specific page that I want to exclude the value "1"?

#1707703

Hi,

Thanks for sharing the update and sorry about the delay in getting back on this.

To make things more clear, I've added the following changes:

1. In the field group "Search Setting", I've added two options "No" and "Yes" with values 0 and 1, respectively for the "Exclude" field.
( screenshot: hidden link )

2. Next, in the "Query Filter" section of your view "Search front page", I've added a custom field filter so that it only brings in the results, where the value of this "Exclude" field is 0.
( screenshot: hidden link )

This means that any posts/pages where you'll set the value of this field to "Yes" (1), they'll not be included in the results of this view.

Important note: Your view "Search front page" is set to show results from the post types: "Posts", "Pages", "Products" and "Camps".
( screenshot: hidden link )

As you already have some posts in these post types, you'll need to open the edit screen of all those existing posts and then save the "Exclude" field's value, with either Yes or No, once. You won't have to repeat this step for any new posts that you'll create in these post types, as by default "No" will be saved automatically, for future posts.

I hope this helps and please let me know if any point is not clear.

regards,
Waqar

#1708793

Hi Waqar,

Okay it seems to work now BUT - a few things: The search bar used to be centered on the page but not it's to the left.
Also the search results used to have space / margin between the columns but now they are all up close.

I didn't want to do anything until I talked to you.

#1709611

Hi,

I noticed that some of the theme's styles are interfering with the built-in Block styles.

To overcome this, you can include the following CSS code in the view's "Custom CSS" field:


.wpv-filter-form .wpv-custom-search-filter.aligncenter {
text-align: center;
}

.js-wpv-loop-wrapper .tb-grid .tb-grid-column .wpv-block-loop-item {
width: 90%;
padding-right: 5%;
padding-left: 5%;
word-break: break-word;	
}

This will center the search field and correct the spacings between the search results.

regards,
Waqar

#1711017

Hi Waqar,

Perfect it seems to work now! thanks!

#1712231

You're very welcome and glad that it works.

Please mark this ticket as resolved and feel free to start a new one, for each new question or concern.

regards,
Waqar

#1712309

My issue is resolved now. Thank you!

#1867519

Hi,

I'd like to update you that the issue involving the grid loop styles when a view is inserted on any other page, has been fixed in the Toolset Blocks 1.3.3 / Views 3.3.3.

regards,
Waqar