I am wondering if I can change the default search options so that people can search for post and title automatically without having to go into the advanced options?
Thank you!
I am wondering if I can change the default search options so that people can search for post and title automatically without having to go into the advanced options?
Thank you!
I was just about to make the same thread, I prefer if my members can only search topic titles, any way to move the options to the admin area and let us choose instead of the members?
@jmwalker yes, you can customize the default setup… look at your search form template tag in the spHead.php template file of your sp theme…
more info: https://simple-press.com/documentation/codex/api/template-functions-and-the-api/display-template-functions/common-view/sp_searchform/
you just need to configure it how you want… as that page shows, most of the search option arguments will be at the top of the spHead.php template file…
@kvr28 no way to move it to options… but you could just configure the defaults the way you want and then just remove the advanced search form if you wanted…
Sorry, I am a bit confused. I found this template file in my theme but there is nothing regaring the search form template tag.
I looked at the link that you gave me but I am not much of a coder so I am not sure what I would adjust in this template file to get the desired outcome.
I am so want to remove the members button on the header of my forum, so that members can’t look at other members profile. Would I edit this same file to do that, or is that a separate question?
Sorry for my ignorance!
so in your spHead.php template file, as per the codex page, you should see something like:
$searchForm = array(
'tagClass' => 'spLeft spSearchForm',
'icon' => 'sp_Search.png',
'inputClass' => 'spControl',
'inputWidth' => 20,
'submitClass' => 'spButton spRight',
'advSearchLinkClass' => 'spLink',
'advSearchLink' => '',
'advSearchId' => 'spSearchFormAdvanced',
'advSearchClass' => 'spSearchFormAdvanced',
'submitLabel' => __sp('Search'),
'advancedLabel' => __sp('Advanced Search'),
'lastSearchLabel' => __sp('Last Search Results'),
'toolTip' => __sp('Search the forums'),
'labelLegend' => __sp('Advanced Search'),
'labelScope' => __sp('Forum Scope'),
'labelCurrent' => __sp('Current forum'),
'labelAll' => __sp('All forums'),
'labelMatch' => __sp('Match'),
'labelMatchAny' => __sp('Match any word'),
'labelMatchAll' => __sp('Match all words'),
'labelMatchPhrase' => __sp('Match phrase'),
'labelOptions' => __sp('Forum Options'),
'labelPostTitles' => __sp('Posts and topic titles'),
'labelPostsOnly' => __sp('Posts only'),
'labelTitlesOnly' => __sp('Topic titles only'),
'labelMinLength' => __sp('Minimum search word length is %1$s characters - maximum search word length is %2$s characters'),
'labelMemberSearch' => __sp('Member Search (Current or All Forums)'),
'labelTopicsPosted' => __sp('List Topics You Have Posted To'),
'labelTopicsStarted' => __sp('List Topics You Started'),
'searchIncludeDef' => 1, # 1 = content, 2 = titles, 3 = content and title (warning #3 is a resource hog)
'searchScope' => 1, # 1 = Current Forum, 2 = All Forums
);
this is from default theme… per that codex page, you can change the default options to what you want.. ie change searchIncludeDef to be 3 instead of the 1…
as always, we strongly recommend you do this via a child theme or your own custom theme to keep from losing changes on updates…
So this is what the sphead.php looks like when I open it. I am not using a child-theme or custom theme but I am reading your codex on how to set that up.
that is why I said it was for default theme.. you are using reboot… so slightly different…
the image you uploaded shows a file getting included.. you need that file… reboot/templates/desktop/spHeadDesktop.php
So I am going through your instructions to set up a child theme of the Reboot theme.
You mention:
the image you uploaded shows a file getting included.. you need that file… reboot/templates/desktop/spHeadDesktop.php
I am using the child theme and have copied this spHeadDesktop.php to the child theme but it is still not showing up.
This file is also in the reboot theme folder, but never showed up as an option to edit.
If I understand the instructions correctly I need to change the information in this file for my child theme so I have renamed the Theme in this file mySiteRebootChild.
The problem is that I still get the same message about needing to edit the spHeadDesktop.php file but that isn’t an available template file. when I try to edit my template as before:
Does that make sense?
Obviously I am missing something and I have read and reread the child theme instructions in the codex. If you can guide me that would be great.
Thanks!
can you explain what you did a bit more? did you start with our reboot-child theme? so that you have a spHead.php template file in the templates folder?
or did you just your child from scratch? in which case you would manually need to add the spHead.php template file…
its the one that calls the file you modified… so if not in your child, it would be including the parent…
I used your reboot-child theme and followed these instructions:
https://simple-press.com/documentation/codex/themes/theme-basics/creating-a-child-theme/
so you created a child right? did you select that child as the theme you want to use?
in your theme, the templates directory, can you post the contents of spHead.php?
and then in your theme, the templates/desktop you copied over the spHeadDesktop.php file from the base reboot theme and edited that file to set up the arguments the way you want?
so you created a child right? did you select that child as the theme you want to use?
Yes, I followed the instructions that are in the codex to create a child by downloading the reboot-child theme. I also followed the instructions in changing the name of the theme and it is selected.
in your theme, the templates directory, can you post the contents of spHead.php?
I don’t understand your question. The reboot-child that I added to my themes had a spHead.php file in it already. I am not sure what content I would post in the spHead.php file when it states that I should use the spHeadDesktop.php file.
and then in your theme, the templates/desktop you copied over the spHeadDesktop.php file from the base reboot theme and edited that file to set up the arguments the way you want?
I have copied over this file, however I can’t see it in the Theme Editor under Template Files. Do I have to edit it in my hosts File Manager. Why can’t I see this file under the Theme Editor in the Forum options on the backend of my WP site?
because unfortunately, its standard wp theme editor which does not go many levels down…
so yes, edit via ftp or via control panel file manager…
but I will open a ticket to see if we can force it to go more levels deep… but sorry, wont help you right now…