change placeholder label in search bar

Home Forums Calendar Products Events Calendar PRO change placeholder label in search bar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1083054
    Matthew
    Participant

    Hi,

    Not long back I had a problem changing the placeholder label on the search bar which Brook solved for me nicely. The snippet no longer seem to be working as the field is labelled location again. Here is the previous support thread:

    How to change heading text in event-bar

    Here is a screenshot of what I’ve got:

    https://nimbus.everhelper.me/client/notes/share/407158/u0cb5bme1i90iblizwzo

    Has the snippet been affected by an update to TEC? Could someone update the snippet so that it works again?

    Thanks,
    Mat

    #1083178
    George
    Participant

    Hey @Matthew,

    I’m sorry about this code no longer working!

    I think this is something we should make more easily filterable, and I will discuss doing so with a developer and see if we can include some filters in some upcoming future release.

    For now, however, I have cooked up a JavaScript solution that should work well. I know JavaScript isn’t ideal, but it should hopefully work well as just a temporary solution for now:


    add_action( 'wp_footer', 'change_location_placeholder_text' );

    function change_location_placeholder_text() {

    if ( ! tribe_is_event() )
    return; ?>

    <script type="text/javascript">
    document.getElementById( 'tribe-bar-geoloc' ).placeholder = 'Enter City or Zip';
    </script>

    <?php
    }

    ☝️ Paste that into your theme’s functions.php file and let me know if it helps!

    Thanks,
    George

    #1084220
    Matthew
    Participant

    Hi George,

    That works nicely, thanks.

    I definitely thing you guys should consider adding customization of this text as an option in an update. The main reason is people will often enter a state and it returns no results even when there are loads of events in that state. I know from forum posts that this is more to do with how google maps works, but customizing the text will allow users to solve the problem themselves.

    Just as a side note. I installed Geo my WP and had the developer insert some customizations to add a ‘use my location’ button and google suggestions to the near field. It works awesome. Anyway, I thought you guys might be interested in adding this feature. You can see it here:

    https://physiocourse.com/events

    #1084267
    George
    Participant

    Thank you, @Matthew!

    That’s a neat customization for sure, and when it comes to adding better support for changing the labels and such, we’re totally on board and are trying to implement some simple filters for such changes.

    Thanks for your patience with our code until those features finally arrive; for now, the snippet I shared should do a decent temporary job. I hope you find this to be the case and I wish you the best of luck with your site!

    — George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘change placeholder label in search bar’ is closed to new replies.