Styling issue with theme | WordPress.org

[ad_1]

Hi Haynzy,
this is something you might need to contact your theme developers about.

Your theme is actively changing the actual HTML of the quizzes and inserting its own elements (specifically a new div with a class name of “notizia-checkbox-control”). It is this new markup that is breaking the toggles.

However, for now, the following will help.

First, add the following CSS to your site. This will stop your theme from overriding the heading colors.

.hdq_results_title, .hdq_question_heading {color:#222 !important}

And now for a fairly “jank” solution to the toggle. What we need to do is detect once a quiz has loaded, then loop through each toggle and remove that extra div that your theme is adding in.

Add the following to your theme’s functions.php file at the very end (place before the closing ?> tag if the file has one). ALWAYS make a backup of this file first in case you make a mistake.

function hdq_haynzy_remove_theme_extra_divs()
{
	?>
<script>
	const remove_divs = document.getElementsByClassName("notizia-checkbox-control");
	while(remove_divs.length > 0){
		remove_divs[0].remove();
	}
</script>
	<?php
}
add_action("hdq_after", "hdq_haynzy_remove_theme_extra_divs");

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer