Skip to content

Instantly share code, notes, and snippets.

@shazdeh
Created January 16, 2017 22:16
Show Gist options
  • Select an option

  • Save shazdeh/61751246ca0e19bf364575f73e0a7d1e to your computer and use it in GitHub Desktop.

Select an option

Save shazdeh/61751246ca0e19bf364575f73e0a7d1e to your computer and use it in GitHub Desktop.
function tf_start_buffer() {
ob_start();
}
add_action( 'wp_head', 'tf_start_buffer', 1 );
function tf_end_buffer() {
$output = ob_get_clean();
if( preg_match( '/class=\"themify_builder_row/', $output ) ) {
$output = str_replace(
'<meta name="builder-styles-css" content="" id="builder-styles-css">',
'<link rel="stylesheet" id="builder-styles-css" href="'. THEMIFY_BUILDER_URI . '/css/themify-builder-style.css' .'" media="all" />',
$output
);
}
echo $output;
}
add_action( 'wp_footer', 'tf_end_buffer', 10000 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment