How to pass code from header.php to footer.php

Avoid global variables, they could be overwritten by other code. You could use a helper function with a static internal variable instead. Sample code: function wpse_69365_var_storage( $var = NULL ) { static $internal; if ( NULL !== $var ) { $internal = $var; } return $internal; } // first call: wpse_69365_var_storage( 4 ); // later … Read more

Formatting ?

You either need to add such code via the HTML editor (and not switch back to the Visual editor), or else you will need to pass a custom configuration to the Visual editor. I have similar needs, and here’s what I use (in functions.php): // http://tinymce.moxiecode.com/wiki.php/Configuration function cbnet_tinymce_config( $init ) { // Change code cleanup/content … Read more

How to Change CSS Variable value in Theme Customizer Live Preview

Quick Note: It looks like you may want to use a Color Control instead of excluding type and getting the default text control. For example, this will turn your text input into a color picker… $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, ‘primary_color’, [ ‘label’ => __( ‘Primary Color’, ‘mytheme’ ), ‘section’ => ‘mytheme_color_options’, ‘type’ => ‘color’ ] … Read more

add_theme_support( ‘custom-header’ ) does not add option menu in dashboard

From Codex: If attached to a hook, it must be after_setup_theme. The init hook may be too late for some features. Try this if ( ! function_exists( ‘mytheme_setup’ ) ): function mytheme_setup() { add_theme_support( ‘custom-header’ ); } endif; add_action( ‘after_setup_theme’, ‘mytheme_setup’ ); If you use Toolbox Theme, find in functions.php function toolbox_setup() { and add … Read more

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