• 18-10-2018, 22:52:44
    #1
    Üyeliği durduruldu
    Merhaba,

    Sitemde litespeed cache kullanmak istiyorum aktif ediyorum çok iyi verim sağlıyorum tek bir eksisi izlenme sayıları vs Postviews çalışmıyor cache ayarlarında ise... bunu düzeltmek için bir makale var birşey anlamadım gerçekten....

    Bu konuda yardımcı olabilecek var ise benim değil birçok kişinin sorunu çözülmüş olacaktır.

    To make LiteSpeed Cache compatible with WP-PostViews:

    1-) Replace the following calls in the active theme's template files with a div or span with a unique ID.

    e.g. Replace
    <?php if(function_exists('the_views' )) { the_views(); } ?>
    with
    <div id="postviews_lscwp" > </div>

    2-) Update the ajax request to output the results to that div.

    Example:

    jQuery.ajax({
    type:"GET",
    url:viewsCacheL10n.admin_ajax_url,
    data:"postviews_id="+viewsCacheL10n.post_id+"&acti on=postviews",
    cache:!1,
    success:function(data) {
    if(data) {
    jQuery('#postviews_lscwp').html(data+' views');
    }
    }
    });
    The ajax code can be found at

    /wp-content/plugins/wp-postviews/postviews-cache.js

    3-) After purging the cache, the view count should be updating.
  • 18-10-2018, 23:20:49
    #2
    Bu kodu:
    <?php if(function_exists('the_views')) { the_views(); } ?>
    Bu kod ile değiştirin diyor:
    <div id="postviews_lscwp"></div>
    Daha sonra ise wp-content/plugins/wp-postviews/postviews-cache.js yolunu takip edip içeriğini aşağıdaki kodlar ile değiştirin diyor.

    jQuery.ajax({     type:"GET",     url:viewsCacheL10n.admin_ajax_url,     data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",     cache:!1,     success:function(data) {         if(data) {             jQuery('#postviews_lscwp').html(data+' views');         }    } });
  • 18-10-2018, 23:23:23
    #3
    Üyeliği durduruldu
    FSahin adlı üyeden alıntı: mesajı görüntüle
    Bu kodu:
    <?php if(function_exists('the_views')) { the_views(); } ?>
    Bu kod ile değiştirin diyor:
    <div id="postviews_lscwp"></div>
    Daha sonra ise wp-content/plugins/wp-postviews/postviews-cache.js yolunu takip edip içeriğini aşağıdaki kodlar ile değiştirin diyor.

    jQuery.ajax({     type:"GET",     url:viewsCacheL10n.admin_ajax_url,     data:"postviews_id="+viewsCacheL10n.post_id+"&action=postviews",     cache:!1,     success:function(data) {         if(data) {             jQuery('#postviews_lscwp').html(data+' views');         }    } });

    <?php if(function_exists('the_views')) { the_views(); } ?>

    Bu kodu nereden bulacağım acaba.


    Anlatım için teşekkür ederim.
  • 18-10-2018, 23:25:43
    #4
    mkadzynn adlı üyeden alıntı: mesajı görüntüle
    <?php if(function_exists('the_views')) { the_views(); } ?>

    Bu kodu nereden bulacağım acaba.


    Anlatım için teşekkür ederim.
    O kodu normalde temaya eklemeniz gerekiyor ki otomatik olarak göstermesini sağlıyor. Shortcode ile mi kullanıyorsunuz siz? Eğer kod yoksa onun yerine single.php'de verdiğim div kodunu content'in hemen üstüne ekleyip deneyin.
  • 18-10-2018, 23:46:05
    #5
    Üyeliği durduruldu
    single.php içine ekledim sayfa açılmadı headere ekledim olmadı :S



    FSahin adlı üyeden alıntı: mesajı görüntüle
    O kodu normalde temaya eklemeniz gerekiyor ki otomatik olarak göstermesini sağlıyor. Shortcode ile mi kullanıyorsunuz siz? Eğer kod yoksa onun yerine single.php'de verdiğim div kodunu content'in hemen üstüne ekleyip deneyin.
    Hocam

    Bu kodu temanın bi dosyasında buldum
    <?php if(function_exists('the_views')) { the_views(); } ?>

    Sitede böyle gözüküyor:
    <div class="yazar"><?php if(function_exists('the_views')) { the_views(); } ?> kez okundu</div>

    Bu kodu nasıl değiştirebilirim hatasız aslında ben bir kaç denedim olmadı belki senin bildiğin birşey vardır ?
    <div id="postviews_lscwp" ></div>
  • 19-10-2018, 13:01:43
    #6
    mkadzynn adlı üyeden alıntı: mesajı görüntüle
    single.php içine ekledim sayfa açılmadı headere ekledim olmadı :S





    Hocam

    Bu kodu temanın bi dosyasında buldum
    <?php if(function_exists('the_views')) { the_views(); } ?>

    Sitede böyle gözüküyor:
    <div class="yazar"><?php if(function_exists('the_views')) { the_views(); } ?> kez okundu</div>

    Bu kodu nasıl değiştirebilirim hatasız aslında ben bir kaç denedim olmadı belki senin bildiğin birşey vardır ?
    <div id="postviews_lscwp" ></div>

    sanırım author.php de bulmuşsunuz eklenti ayarlarından otomatik ekleyi kaldırıp single.php ye manuel olarak eklerseniz sorun çözülecektir.