Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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
    screenshot Suche

    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.
    Thanks

    #982020

    In 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.

    Screenshot

    #982284

    Hi,

    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,
    Basilis

    #982419

    Ok, 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, 3 months ago by Max.
    #982435

    Ok 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,
    Ismael

    That work perfectly with the standard code in the searchform.php.

    Thanks!

    • This reply was modified 6 years, 3 months ago by Max.
    #982635

    Hi,

    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,
    Rikard

    #983587

    You can close it.

    #983823

    Hi,

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘search form focus problem’ is closed to new replies.