You can use filter ‘jetpack_widget_get_top_posts’ to filter ‘title’ and ‘permalink’ of top posts.
Thread Starter
refan
(@refan)
Hi Alex,
Did you mean use filter configure in function.php (theme) and what the script to use filter?
Thanks
> Did you mean use filter configure in function.php (theme)
in functions.php
add_filter('jetpack_widget_get_top_posts', 'filter__jetpack_widget_get_top_posts', 10, 3);
function filter__jetpack_widget_get_top_posts($posts, $post_ids, $count) {
if ( class_exists('WPGlobus') ) {
foreach( $posts as $_key=>$post ) {
$posts[$_key] = WPGlobus_Core::text_filter($post['title'], WPGlobus::Config()->language);
}
}
return $posts;
}
Thread Starter
refan
(@refan)
Hi Alex,
After put the code use filter in functions.php no posts to display. Whats next to fixed?
Thanks
Thread Starter
refan
(@refan)
Hi Alex,
I’m still stuck with this issue. About marks language module jetpacks. I’d follow your instruction to put the code in functions.php and got the message:
Warning: Illegal string offset ‘post_type’ in /var/www/vhosts/localhost/httpdocs/wp-content/plugins/jetpack/modules/widgets/top-posts.php on line 291
Help me please!
You can submit request on site
wpglobus.com