Collapsible button inside a ul list does work in jsfiddle but not in WP

Solution provided by Steven <script type=”text/javascript”> ( function() { coll = document.getElementsByClassName(“col”); conn = document.getElementsByClassName(“con”); var i; for (i = 0; i < coll.length; i++) { coll[i].setAttribute(‘data-id’, ‘con’ + i); conn[i].setAttribute(‘id’, ‘con’ + i); coll[i].addEventListener(“click”, function() { this.classList.toggle(“active”); var content = document.getElementById(this.getAttribute(‘data-id’)); if (content.style.maxHeight) { content.style.maxHeight = null; } else { content.style.maxHeight = content.scrollHeight + … Read more

Can I use theme options to change two things at once?

Nothing prevents you from retrieving your option in several places. You can do several get_option() calls or create global variable and assign your value to it once. It is hard to come up with specific example without knowing what exactly you store in option and which classes you want to generate for your markup. Update … Read more

Duplicate and alter sidebar for Twenty Eleven

the layout is controlled by the .singular css class, which in turn is generated in functions.php depending on the template. in your child theme of Twenty Eleven (if you don’t have a child theme, create one first) add this code to functions.php: add_filter(‘body_class’, ‘wpse_28044_adjust_body_class’, 20, 2); function wpse_28044_adjust_body_class($wp_classes, $extra_classes) { if( is_page_template(‘submenu-page.php’) ) : // … Read more

How to load different css file depending on language

function load_my_styles() { wp_register_style( ‘my-en-style1’, plugins_url( ‘en-style1.css’, __FILE__ ) ); wp_register_style( ‘my-en-style2’, plugins_url( ‘en-style2.css’, __FILE__ ) ); wp_register_style( ‘my-ja-style1’, plugins_url( ‘ja-style1.css’, __FILE__ ) ); wp_register_style( ‘my-ja-style2’, plugins_url( ‘ja-style2.css’, __FILE__ ) ); $lang = preg_match( ‘/^\/ja\//i’, $_SERVER[‘REQUEST_URI’] ) ? ‘ja’ : ‘en’; wp_enqueue_style( “my-{$lang}-style1” ); wp_enqueue_style( “my-{$lang}-style2” ); } add_action( ‘wp_enqueue_scripts’, ‘load_my_styles’ );

How to change Parent Themes in Child Theme CSS

I think you are confused about this. Let me explain. The @import url(“../responsive/style.css”); is telling the Child theme to import the Responsive themes style.css. This is important because without this the Child theme doesn’t know what its Parent theme is. So the @import url(“../responsive/style.css”); points the Child theme to the default (main) file in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)