Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add WP search to archive, limited to wpfc_sermon post type and AND match #159

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

tstephen
Copy link
Contributor

This PR adds a WordPress search form to the archive page.

Currently hard-coded are that it will return only WPFC sermons and applies 'sentence' search, in other words if you search Ruth and Eddie (one of our preachers) only matches of both will be returned.

I did wonder if it should be an option to exclude the new search form but I think it is a useful addition to everyone and I see search is listed on your Trello board. This is not search like Sermon Browser used to do it but I do believe it is more in keeping with WP guidelines and don't anticipate users having a problem understanding it (time will tell!).

Finally by adding a CSS class to the form it can be pretty easily integrated into different themes.

Hope you like it but if not please suggest changes.

@nikola3244 nikola3244 added this to the 2.11 milestone Jan 14, 2018
@nikola3244
Copy link
Contributor

Thanks for the PR 👍

This PR adds a WordPress search form to the archive page.

Actually, the form will be only added to the shortcode output.
The archive page view is controlled by this file (if Enable Template Files option is enabled), and if that option is disabled, sermons content on archive pages is only controlled by "per-sermon" basis (i.e. we only change individual sermon content on archive page) - see here.

There might be a filter to add content into archive page "header", but I haven't researched it, and I doubt that it will work for all themes.

Anyhow, I wonder, how is this different than adding a search form in widget[1]? (except that post type is hardcoded to wpfc_sermon)

I did wonder if it should be an option to exclude the new search form

I personally think that there should be an option (and disabled by default for existing installations), since we don't want to break user's page layout on update. Many of them won't be aware of the change and will come to the support forum to (rightfully) complain when they find out that their layout is "broken". Also, plenty of churches (at least in our experience) had their website design done many years ago without any updates - because they hired a person/agency to do all the work since they don't know web development, and this type of changes would mostly be problematic to them.

Also, let's have strings translated by putting them into correct translation functions.

What are your thoughts about it?


[1] - Or some other way if they are using a visual editor of some sort (such as Visual Composer or Elementor)

@nikola3244
Copy link
Contributor

As you maybe noticed, I accidentally manually added and released the code from this PR.

That was not supposed to happen.
My guess is that I was too tired and haven't noticed that it accidentally got commited in f8e6ad3.
I just copied it into local to see how it works, but hey... it happened.

I've removed it in 81781a2 and it will be officially removed in 2.11.2 once we fix another bug.

My apologies for this, it was my mistake.

@nikola3244 nikola3244 modified the milestones: 2.11.0, Future Releases Jun 8, 2018
@tstephen
Copy link
Contributor Author

Sorry it took me ridiculously long to return to this.

You asked:

how is this different than adding a search form in widget[1]? (except that post type is hardcoded to wpfc_sermon)

That's obviously fine if I happen to have a widget area in just the right place but otherwise it's not the same at all!

As noted I'm trying to recreate the old Sermon Browser search functionality really but this seemed a suitable shortcut rather than trying to build something from scratch.

Looking at it fresh now how do you feel about a [sermon_search] shortcode? Would you prefer to rely on the underlying WP search or something lower level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants