This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Search action creates SSL mixed content error in Chrome

  • Creator
    Topic
  • #23687
    Mary Makowsky
    Participant

    Hi Jason,

    I’m getting the padlock with a warning sign (mixed content) in Chrome because the action on my search form is not using https on secure pages. Is there a way to change this is the searchform.php so the action just uses http or https according to what the current page is using?:

    action=”<?php echo esc_url( trailingslashit(themeblvd_get_home_url()) ); ?>”

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #23689
    Jason Bobich
    Keymaster

    Hi Mary,

    Probably the easiest would be just move searchform.php to your child theme, and then you’re going to change that output of the form action to:

    <?php echo esc_url( '/', 'https' ); ?>

    See here: https://codex.wordpress.org/Function_Reference/home_url

    #23692
    Mary Makowsky
    Participant

    That didn’t work either. Thinking my https plugin is behind it.

    Thanks for your time.

    #23693
    Jason Bobich
    Keymaster

    Apologies, I see above I mistyped. I forgot to type the home_url() function, which is obviously the main part! ha … try this.

    <?php echo esc_url( home_url( '/', 'https' ) ); ?>
    #23696
    Mary Makowsky
    Participant

    Actually the first string worked but only when I put it in the JumpStart searchform.php. It doesn’t seem to be recognizing the searchform.php in my child theme. I’ll try to figure that out.

    In the meantime, it’s working using:

    <?php echo esc_url( '/', 'https' ); ?>

    But it didn’t work with:

    <?php echo esc_url( home_url( '/', 'https' ) ); ?>

    Weird, huh?

    I really do appreciate your time. Have a great weekend!

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