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.
litespeed cache ve Postviews ikilisi
5
●345
- 18-10-2018, 23:20:49Bu 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Üyeliği durdurulduFSahin 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. - 18-10-2018, 23:25:43O 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.mkadzynn adlı üyeden alıntı: mesajı görüntüle
- 18-10-2018, 23:46:05Üyeliği durduruldusingle.php içine ekledim sayfa açılmadı
headere ekledim olmadı :S
HocamFSahin adlı üyeden alıntı: mesajı görüntüle
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:43mkadzynn adlı üyeden alıntı: mesajı görüntüle
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.
headere ekledim olmadı :S