Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Héctor Cabrera on "[Plugin: WordPress Popular Posts] Sorry no data"

$
0
0

There might be a way around it but since I'm busy and can't check for myself at the moment, you'll have to do it for me:

  1. Go to Plugins > Editor and select WordPress Popular Posts from the dropdown on the right.
  2. Find:
    // WPML support, get original post/page ID
    if ( defined('ICL_LANGUAGE_CODE') && function_exists('icl_object_id') ) {
    	global $sitepress;
    	$id = icl_object_id( $id, get_post_type( $id ), false, $sitepress->get_default_language() );
    }

    ... and change it to:

    // WPML support, get original post/page ID
    if ( defined('ICL_LANGUAGE_CODE') && function_exists('icl_object_id') ) {
    	$wpml_options = get_option( 'icl_sitepress_settings' );
    	$id = icl_object_id( $id, get_post_type( $id ), false, $wpml_options['default_language'] );
    }
  3. Hit the Update file button to save changes.

Please let me know how it goes.


Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>