Support » Plugin: Directorist - Business Directory Plugin » Change listing title from h2 to h1

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter beezlebub

    (@beezlebub)

    Currently my listing titles are all h2 by default, I need them to be h1.

    Thread Starter beezlebub

    (@beezlebub)

    Currently my listing titles are all h2 by default, I need them to be h1.

    Plugin Support Rafiz Sejim

    (@rafizsejim)

    Greetings,

    Please add the folllowing snippet in Appearance > Theme editor > functions.php (For custom codes it is best to use child themes)

    function sw_title_change() {
        wp_enqueue_script( 'jquery' );
    	?>
    
     <script>
    jQuery(document).ready(function($) {
    	$('.directorist-listing-details .directorist-listing-details__listing-title').each(function(){
    		$(this).replaceWith($("<h1 class='directorist-listing-details__listing-title'>" + $(this).html() + "</h1>"));
    	});
    });
    </script>
    <?php }
    add_action( 'wp_footer', 'sw_title_change');
    ?>

    Regards,

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