• Resolved Djib's

    (@djibs13)


    It’s me again;-)

    I use your plugin since few days and it works very well.

    But he asks me some performance issues because I have 15,000 posts.

    I wish to keep the synchronization every 3600 seconds for recent posts (maximum one month). For older articles, I will wish to establish a single synch daily.
    Can you help me ?

    https://ww.wp.xz.cn/plugins/post-share-count/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author zviryatko

    (@zviryatko)

    Hi again)

    Pass ‘time’ parameter to function, example (inside the loop):

    if ( post_is_older() ) {
      the_post_share_count(array('time' => 60*60*24));
    } else {
      the_post_share_count(array('time' => 3600));
    }

    where post_is_older() is your custom function which returns true if post is old.

    Thread Starter Djib's

    (@djibs13)

    Tahnk you !
    I did that, it seems ok?

    $current_date = date(‘my’);
    if ( $current_date > get_the_time( ‘my’ ) ) {
    the_post_share_count(array(‘time’ => 60*60*24));
    } else {
    the_post_share_count(array(‘time’ => 3600));
    }

    Plugin Author zviryatko

    (@zviryatko)

    Yes, it ok 😉

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Synchronisation for old posts’ is closed to new replies.