yrmyrm
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [OceanWP] Reading time (in metabox) is always 1 minJust in case this post will show up while someone will search for the same problem – I’ve found a solution.
Using the code that is here:
https://github.com/oceanwp/oceanwp/blob/690f380e72083b4735e4d71c65403303031ec6d7/inc/helpers.php#L3153and the tip that is here:
https://stackoverflow.com/questions/23015600/str-word-count-for-non-latin-words/23015645#23015645I’ve copied the code from the first link, and changed –
str_word_count( strip_tags( $content ) );
with
count(preg_split(‘/\s+/’, $content));Problem solved.
Edit:
Obviously, in case of a language different from English, you should estimate what’s the average of words that are read in a minute, and change calculation if necessary.- This reply was modified 5 years ago by yrmyrm.
Forum: Plugins
In reply to: [WP Telegram Widget and Join Link] ShortcodeThanks!
Forum: Plugins
In reply to: [WP Telegram Widget and Join Link] ShortcodeThank you.
What if I want to set it on a page not on sidebar? In what file should I type the following code (in order for shortcode to work, and considering I’m using child theme)
<?php
if ( function_exists( ‘wptelegram_widget’ ) ) {
$args = array(
// ‘num_messages’ => 5,
// ‘widget_width’ => 100,
// ‘author_photo’ => ‘auto’,
);wptelegram_widget( $args );
}
?>Thanks again