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
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.
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"?
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
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.
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
Hi Waqar,
Perfect it seems to work now! thanks!
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
My issue is resolved now. Thank you!
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