Whats the safest way to output custom JavaScript and Css code entered by the admin in the Theme Settings?

Allowing user to control code is explicitly unsafe operation. As you note the purpose of sanitization is pretty much to not let user slip in anything executable and/or with malicious intent. To “sanitize” executable code you would need programmatic understanding of it (code parser) and criteria engine to distinguish what is safe and what is … Read more

Default header image does not display

You should register the default headers using register_defaults_headers – e.g. register_default_headers( array( ‘default-image’ => array( ‘url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘thumbnail_url’ => get_stylesheet_directory_uri() . ‘/assets/img/default-header.jpg’, ‘description’ => __( ‘Default Header Image’, ‘textdomain’ ) ), ) ); See the codex entry for more info on the function – https://codex.wordpress.org/Function_Reference/register_default_headers. The Codex isn’t clear, but this function … Read more

Theme check: Missing a text-domain

Let us look at the relevant line. I am reformatting it to easier understand what is going on: printf( _n(‘1 comment’, ‘%1$s comments’, get_comments_number() ), number_format_i18n( get_comments_number() ), ‘text-domain’ ); So what you are doing is calling printf with three parameters, each one now being on a separate line now as I formatted it. But … Read more

Theme Customizer not loading

if customizer(live preview) doesnt work or doesnt load and nothing is shown, try these steps: do you have redirections on the problematic site (double check and ensure, there might be coded a custom redirection in your plugins/codes)? while the circle is still loading, change any option in customizer and click “SAVE & PUBLISH” and see, … Read more

Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?

You can place it in header.php between starting <head> and closing </head> tags and it should work properly. Or perhaps a better solution would be to enqueue the style in functions.php function google_fonts() { $query_args = array( ‘family’ => ‘Sigmar+One’ ); wp_register_style( ‘google_fonts’, add_query_arg( $query_args, “//fonts.googleapis.com/css” ), array(), null ); } add_action(‘wp_enqueue_scripts’, ‘google_fonts’);

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