Generation

generate functionSun, 12 Feb 2023

write a joomla function to find the first h2 tag in the content and insert a html content after this tag

function joomla_function( $content ) { $content = preg_replace('/(<h2[^>]*>)/', '$1' . '<div class="extra-content">', $content, 1); return $content; } add_filter( 'the_content', 'joomla_function' );

Questions about programming?Chat with your personal AI assistant