Support

Home Forums Event Espresso Premium Custom CSS for tickets

Custom CSS for tickets

Posted: June 18, 2015 at 2:18 pm


Nick

June 18, 2015 at 2:18 pm

Hi,

What’s the simplest way to create custom CSS for tickets in EE4?

Thanks,

NIck


Nick

June 18, 2015 at 2:20 pm

Mmmh, I realise that I can of course add inline CSS to the global HTML template, but is there a way of creating a custom CSS file that won’t be overwritten when updating EE?


Josh

  • Support Staff

June 18, 2015 at 2:51 pm

Hi Nick,

There is! In the following example, we’ll add a stylesheet (or custom CSS file) to a WP child theme, and use a filter to load it in instead of the default CSS.

1) You add the following to your child theme’s functions.php file:

function ee_modify_ticket_variation( $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, EE_Messages_Template_Pack $template_pack ) {
	if ( $messenger != 'html' ) {
		return $variation_path;
	}

	if ( $message_type != 'ticketing' ) {
		return $variation_path;
	}

	if ( $type != 'main' ) {
		return $variation_path;
	}
 
	$new_url = get_stylesheet_directory_uri() . '/new_ticket_variation.css';
	return $new_url;
}
add_filter( 'FHEE__EE_Messages_Template_Pack__get_variation', 'ee_modify_ticket_variation', 10, 8 );

2) Copy all of the styles you modify (or start fresh) into new_ticket_variation.css. This file should go into your WP child theme.

The support post ‘Custom CSS for tickets’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 4 years, 6 months ago ago

Topic Tags

Tagged: , ,

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!