Unwanted blank lines before tag

the_content doesn’t affect the DOCTYPE and <html> tags, only the post/page content. One of your plugins, or something else in the theme is either throwing an error, or is printing something earlier than it should. Have you tried: Disabling each plugin one by one and see when it is fixed. Editing wp-config.php and adding define( … Read more

Change date number to another language/script?

Please try this way: Change date, the_date, the_time to get_date, get_the_date, get_the_time. function KhmerNumDate ($text) { $text = str_replace(‘1’, ‘១’, $text); $text = str_replace(‘2’, ‘២’, $text); $text = str_replace(‘3’, ‘៣’, $text); $text = str_replace(‘4’, ‘៤’, $text); $text = str_replace(‘5’, ‘៥’, $text); $text = str_replace(‘6’, ‘៦’, $text); $text = str_replace(‘7’, ‘៧’, $text); $text = str_replace(‘8’, ‘៨’, … Read more

Enqueued Stylesheets Effecting Admin Styles

You could do it like this: function theme_styles(){ /* * This if() statement is unnecessary, as wp_enqueue_scripts * doesn’t fire on the admin pages. * if( is_admin() ) { * return; * } */ wp_enqueue_style( ‘theme-styles’, get_template_directory_uri() . ‘/css/all.css’, array(), false, ‘all’ ); } add_action( ‘wp_enqueue_scripts’, ‘theme_styles’ ); References is_admin() Also, note that the wp_enqueue_scripts … Read more

Disable the Custom Internal CSS added by theme.json for Certain Pages

We can look into the wp_enqueue_global_styles() function, that calls wp_should_load_separate_core_block_assets() and see it contains e.g. the should_load_separate_core_block_assets filter but we can’t disable the global styles on the front-end, using this filter because of: /* * Global styles should be printed in the head when loading all styles combined. * The footer should only be used … Read more