function bavotasan_word_count() {
return sprintf(
__( '%s words', 'text-domain' ),
str_word_count( strip_tags( get_post_field( 'post_content', get_the_ID() ) ) )
);
}
Bunu denedim birde şu kodu buldum ve denedim;
CODE1:
<?php
function bac_post_word_count()
{
global $post;
//Variable: Additional characters which will be considered as a 'word'
$char_list = ''; /** MODIFY IF YOU LIKE. Add characters inside the single quotes. **/
//$char_list = '0123456789'; /** If you want to count numbers as 'words' **/
//$char_list = '&@'; /** If you want count certain symbols as 'words' **/
echo str_word_count(strip_tags($post->post_content), 0, $char_list);
}
?>
Tapatalk kullanarak iPhone aracılığıyla gönderildi