Need ` <meta http-equiv=”Content-Type”
content=”<?php bloginfo( ‘html_type’ ); ?>; charset=<?php bloginfo( ‘charset’ ); ?>”/>` in header on theme or
add_action('wp_head', function(){
?>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</php
})
in custom plugin/theme functions. HTML5 <meta charset="UTF-8">
is supposed to do it but it just doesn’t work
Fixing the Character Encoding Mismatch Problem in WordPress
Step 1) Open the ‘wp-config.php’ file in a text editor such as notepad (the wp-config.php file can be found on the directory where you installed WordPress).
Step 2) Find the following two lines and comment them out:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
They should look like the following after you comment them out:
//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE', '');
Step 3) Now upload the updated ‘wp-config.php’ file to your webhost (overwriting the old one).
Credit goes to – Tips and Tricks HQ
-
This reply was modified 7 years, 3 months ago by dush88gs.
@dush88gs you need to set the charset in the document, not disable the defined encoding. What I posted has worked every time for me.
(@pcfreak30) Derrick Hammer
plz explain in details how to use this codes, because i have little experinces and i am not able to find the location to put this code
and this is new code or replaced an old one
sorry for this but really i am new and fresh wordpress user
@futureskills
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
can be added in the head area of your header.php theme (child ideally(, or the wp_head code into the functions.php of your child theme.
Should actually be instead `<meta http-equiv=”Content-Type”
content=”<?php bloginfo( ‘html_type’ ); ?>; charset=<?php bloginfo( ‘charset’ ); ?>”/>` or
`
add_action(‘wp_head’, function(){
?>
<meta http-equiv=”Content-Type”
content=”<?php bloginfo( ‘html_type’ ); ?>; charset=<?php bloginfo( ‘charset’ ); ?>”/>
</php
})
`
sorry again, really i am so sorry
you mean replace this part
<meta http-equiv=”Content-Type”
content=”<?php bloginfo( ‘html_type’ ); ?>; charset=<?php bloginfo( ‘charset’ ); ?>”/>` or
with
add_action(‘wp_head’, function(){
?>
<meta http-equiv=”Content-Type”
content=”<?php bloginfo( ‘html_type’ ); ?>; charset=<?php bloginfo( ‘charset’ ); ?>”/>
</php
})
and also where i can find this part
No, I gave you two routes to go for fixing. Adding to the functions or using the header.php in a child them and adding to the head. You dont need both.
thanks i will try this
but i hope to ask after i add the plugins i notice that https disappear, is this from the plugin installed
I don’t see why any of my plugins would disable https. Can you clarify what you mean by “disappear”?
i do it as shown (add at the first of header.php of my theme)
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class=”no-js”>
but it seems the site is broken and is not showing in a correct manner
arab-academy.com
yes, it was my erorr browse didn’t show the green https so i think it was error
now, i add
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> at the first line of header.php in my theme
the arabic language appear, but the site styple is broken
arab-academy.com
For me to assist anymore to fix your problems, you will need to hire me at https://codeable.io/developers/derrick-hammer/
I will have to go into your code and so that will cost.
You can also test with just wp-rocket and none of my plugins and if the issue still exists ask wp-rocket support.
Thanks.
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
And in that note I am closing this topic. That’s per the forum welcome.
https://make.wordpress.org/support/handbook/forum-welcome/#do-not-offer-to-work-for-hire
This topic was hijacked from the original post 4 months ago and that’s not cool.