Support

Home Forums Event Espresso Premium Best way to add meta name="viewport" to HTML ticket template?

Best way to add meta name="viewport" to HTML ticket template?

Posted: July 26, 2016 at 1:42 pm

Viewing 4 reply threads


MoDiva

July 26, 2016 at 1:42 pm

Hi, I would like the following meta tag added to my HTML ticket template without losing the change when a plugin update is made:
<meta name="viewport" content="width=device-width, initial-scale=1">

Up until a few days ago I had this added to the body of the “HTML Ticket Template” and it worked perfectly, but now it’s being stripped out and as a result the tickets are displayed too small when viewed on a smartphone.

Suggestions?

Thank you!


Lorenzo Orlando Caum

  • Support Staff

July 26, 2016 at 4:30 pm

Hello,

Is that being added within the Text view (https://cl.ly/1e0l2h1Q2o0t) of the messages editor? If so, then it should hold without being removed.

If you are actively switching between Text and HTML for editing, then that could remove it. In that case, I would add it after your other customizations have been made.


Lorenzo


MoDiva

July 27, 2016 at 11:27 am

Hi and thank you for your prompt reply.

Yes, I am switching back and forth between html and text view and in doing so, you are correct, this line gets removed.

Is there a way to add this line of code to the template using a new function in my child theme’s function.php file? If yes, can you please supply that code? Or must I add it to the template itself? If yes, can you please tell me the path/name of the file?

Thank you!


Josh

  • Support Staff

July 27, 2016 at 4:14 pm

You can add the following code to your child theme’s functions.php file to add the meta tag:

function ee_add_meta_tag_html_message_head() {
    echo '<meta name="viewport" content="width=device-width, initial-scale=1">';
}
add_action( 'AHEE__EE_Html_Messenger_main_wrapper_template_head', 'ee_add_meta_tag_html_message_head' );


MoDiva

July 28, 2016 at 11:40 am

Perfect, thank you.

Viewing 4 reply threads

The support post ‘Best way to add meta name="viewport" to HTML ticket template?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso