-
AuthorPosts
-
July 5, 2018 at 5:31 pm #981672
Hi,
i am using this code in the searchform.php instead of the original part.
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <div> <label class="screen-reader-text" for="s">Search for:</label> <input type="text" placeholder="<?php _e('Produktsuche', 'avia_framework')?>" id="s" autofocus name="<?php echo $search_params['search_id']; ?>" value="<?php if(!empty($_GET['s'])) echo get_search_query(); ?>" placeholder='<?php echo $search_params['placeholder']; ?>' > <input type="submit" id="searchsubmit" value="Suche" disabled> <input type="hidden" name="post_type" value="product"> </div> </form>
And it looks like this on http://www.indien-haus.de
I use the “disable” command to get cursor focus in the text field instead of the “Suche” button. It works BUT in Chrome and Firefox i can´t push the button anymore. In Safari and IE it work totally fine.
I hope you can help me with this.
ThanksJuly 6, 2018 at 1:00 pm #982020In addition to this problem it seems to be that the original search form is still there and having some output sometimes. As you can see at the screenshot, the pre results are showing at the wrong location.
July 6, 2018 at 11:53 pm #982284Hi,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
BasilisJuly 7, 2018 at 12:01 pm #982419Ok, i understand. Lets try it easier.
That is the former code. This code was working fine except, it had no focus in the text field but on the search button. Maybe you can give me a hint with this.<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>"> <div> <label class="screen-reader-text" for="s">Search for:</label> <input type="text" placeholder="<?php _e('Produktsuche', 'avia_framework')?>" name="s" id="s" autofocus> <input type="submit" id="searchsubmit" value="Suche"> <input type="hidden" name="post_type" value="product"> </div> </form>
When i use the standard code from Enfold the results are only in textform. I found some people in the forum had the same problem. For a online text results are not possible and practicable.
- This reply was modified 6 years, 5 months ago by Max.
July 7, 2018 at 1:08 pm #982435Ok i found a solution in the forum from Ismael.
Hey radugidei,
Thank you for using Enfold.
This is possible but the search form will be limited to products. It won’t be able to fetch other post types. Please add this in the functions.php file:
// add post type product
add_action(‘ava_frontend_search_form’,’ava_frontend_search_form_mod’);
function ava_frontend_search_form_mod()
{
echo ‘<input type=”hidden” name=”post_type” value=”product”>’;
}
Best regards,
IsmaelThat work perfectly with the standard code in the searchform.php.
Thanks!
- This reply was modified 6 years, 5 months ago by Max.
July 8, 2018 at 6:43 am #982635Hi,
Great, glad you found a solution and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJuly 10, 2018 at 12:12 pm #983587You can close it.
July 10, 2018 at 9:08 pm #983823Hi,
Glad we could help!
Please take a moment to review our theme and show your support https://themeforest.net/downloads
Don’t forget to bookmark Enfold Documentation for future reference.Thank you for using Enfold :)
Best regards,
Basilis -
AuthorPosts
- The topic ‘search form focus problem’ is closed to new replies.