• Resolved Mick

    (@haarbollen)


    Hi
    I would like to add an infocus to the html-code – where do I find the input field for search bare with overlay?

    Thanks in advance

    Mick

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author CrestaProject

    (@crestaproject)

    Hi @haarbollen,

    are you looking for the CSS path or do you want to know in which file the HTML code that generates the file is located?

    If you’re looking for the CSS selector, it’s this one:

    .search-container input[type="search"]:focus

    If you want to know which file the HTML code is in, here it is:

    /themes/elementare/footer.php from the line 21 to the line 23

    Thanks

    Thread Starter Mick

    (@haarbollen)

    Hi CrestaProject

    I was looking for the actual input-field, from the footer.php is put in:
    <?php get_search_form(); ?>
    – from where does it get the actual HTML input field?
    (I am no php-shark in any possible way, I have to say)

    Thanks in advance

    Mick

    Thread Starter Mick

    (@haarbollen)

    I might have put it wrong: I would like to add an ‘autofocus’ to the html :o)

    Theme Author CrestaProject

    (@crestaproject)

    Hi @haarbollen
    get_search_form() is a WordPress function (you can read more about it here).
    This function takes care of printing the HTML code for the search form.

    Theme Author CrestaProject

    (@crestaproject)

    @haarbollen
    If you want to add autofocus to the search button when it appears, then I can do that in the next theme update.
    I’ll put it on the todolist 🙂

    Thread Starter Mick

    (@haarbollen)

    HI again – I use the theme for different projects that doesn’t have to have the same outcome/look – I just wanted one of the searchboxes to be with autofocus – all of the others I use they are just fine as they are :o)

    Theme Author CrestaProject

    (@crestaproject)

    Hi @haarbollen
    this is a javascript code that will insert autofocus into the search field when it appears.

    (function($) {
        $(document).ready(function() {
            $('.search-button').click(function() {
                setTimeout(() => {
                    $('.search-container .search-field').focus();
                }, 200);
            });
        });
    })(jQuery);

    There are various plugins that allow you to add javascript code into your website, you can use whichever you prefer.

    Thanks

    Thread Starter Mick

    (@haarbollen)

    Works perfect, thanks a lot!!

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.