admin管理员组文章数量:1026989
I currently have a big apostrophes problem when my articles are published on my website, because for an example of a word like "l'associé", my article is published with characters that replace the apostrophe like on the image in attachment.
I specify that I use an automatic publishing plugin (using rss feeds) and oddly, when I post (manually) an article and that I add quotes there is no problem.
I checked the encoding of my database that was in utf8mb4 general but that I changed to utf8 general to see if I could solve my problem, but nothing changed, I also checked with notepad ++ if there was not one by checking that my file wp-config.php was not encoded in utf8 with bom, which usually creates accent problems in French.
So I suspect it could come from either the wordpress theme (Sahifa) or the plugin (wp-automatic) that publishes my articles from rss feeds.
Do you have a track that can guide me on the origin of the problem?
I currently have a big apostrophes problem when my articles are published on my website, because for an example of a word like "l'associé", my article is published with characters that replace the apostrophe like on the image in attachment.
I specify that I use an automatic publishing plugin (using rss feeds) and oddly, when I post (manually) an article and that I add quotes there is no problem.
I checked the encoding of my database that was in utf8mb4 general but that I changed to utf8 general to see if I could solve my problem, but nothing changed, I also checked with notepad ++ if there was not one by checking that my file wp-config.php was not encoded in utf8 with bom, which usually creates accent problems in French.
So I suspect it could come from either the wordpress theme (Sahifa) or the plugin (wp-automatic) that publishes my articles from rss feeds.
Do you have a track that can guide me on the origin of the problem?
Share Improve this question asked Mar 21, 2019 at 11:45 Frenchy_WPFrenchy_WP 191 silver badge6 bronze badges2 Answers
Reset to default 1This actually happens to me. I usually resolve this via string replace function. First one replaces the WordPress Content area. The second filter is replacing the Title area.
Check out the str_replace array and insert your œ
to your own string before the $content array.
function replace_the_content_filter( $content ) {
if ( is_single() )
// Add image to the beginning of each page
$content = str_replace(array('«','"', '“', '”'), '"', $content);
// Returns the content.
return $content;
}
add_filter( 'the_content', 'replace_the_content_filter', 20 );
function replace_the_title_filter( $content ) {
// Add image to the beginning of each page
$content = str_replace(array('«','"', '“', '”'), '"', $content);
// Returns the content.
return $content;
}
add_filter( 'the_title', 'replace_the_title_filter', 20 );
I hope that helps. Please be careful on the Title or Content section. If you wanna do it on Attachment title then check the https://developer.wordpress/reference/hooks/wp_get_attachment_caption/.
Goodluck.
Simpler still:
function RemoveTheSlashes( $content )
{
$FixedContent = stripslashes($content);
// Returns the content.
return $FixedContent ;
}
add_filter( 'the_content', 'RemoveTheSlashes', 20 );
Will turn this: /' into just the '
I currently have a big apostrophes problem when my articles are published on my website, because for an example of a word like "l'associé", my article is published with characters that replace the apostrophe like on the image in attachment.
I specify that I use an automatic publishing plugin (using rss feeds) and oddly, when I post (manually) an article and that I add quotes there is no problem.
I checked the encoding of my database that was in utf8mb4 general but that I changed to utf8 general to see if I could solve my problem, but nothing changed, I also checked with notepad ++ if there was not one by checking that my file wp-config.php was not encoded in utf8 with bom, which usually creates accent problems in French.
So I suspect it could come from either the wordpress theme (Sahifa) or the plugin (wp-automatic) that publishes my articles from rss feeds.
Do you have a track that can guide me on the origin of the problem?
I currently have a big apostrophes problem when my articles are published on my website, because for an example of a word like "l'associé", my article is published with characters that replace the apostrophe like on the image in attachment.
I specify that I use an automatic publishing plugin (using rss feeds) and oddly, when I post (manually) an article and that I add quotes there is no problem.
I checked the encoding of my database that was in utf8mb4 general but that I changed to utf8 general to see if I could solve my problem, but nothing changed, I also checked with notepad ++ if there was not one by checking that my file wp-config.php was not encoded in utf8 with bom, which usually creates accent problems in French.
So I suspect it could come from either the wordpress theme (Sahifa) or the plugin (wp-automatic) that publishes my articles from rss feeds.
Do you have a track that can guide me on the origin of the problem?
Share Improve this question asked Mar 21, 2019 at 11:45 Frenchy_WPFrenchy_WP 191 silver badge6 bronze badges2 Answers
Reset to default 1This actually happens to me. I usually resolve this via string replace function. First one replaces the WordPress Content area. The second filter is replacing the Title area.
Check out the str_replace array and insert your œ
to your own string before the $content array.
function replace_the_content_filter( $content ) {
if ( is_single() )
// Add image to the beginning of each page
$content = str_replace(array('«','"', '“', '”'), '"', $content);
// Returns the content.
return $content;
}
add_filter( 'the_content', 'replace_the_content_filter', 20 );
function replace_the_title_filter( $content ) {
// Add image to the beginning of each page
$content = str_replace(array('«','"', '“', '”'), '"', $content);
// Returns the content.
return $content;
}
add_filter( 'the_title', 'replace_the_title_filter', 20 );
I hope that helps. Please be careful on the Title or Content section. If you wanna do it on Attachment title then check the https://developer.wordpress/reference/hooks/wp_get_attachment_caption/.
Goodluck.
Simpler still:
function RemoveTheSlashes( $content )
{
$FixedContent = stripslashes($content);
// Returns the content.
return $FixedContent ;
}
add_filter( 'the_content', 'RemoveTheSlashes', 20 );
Will turn this: /' into just the '
本文标签: pluginsProblem of encoding characters (apostrophes) in my posts publications
版权声明:本文标题:plugins - Problem of encoding characters (apostrophes) in my posts publications 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745661644a2161925.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论