Exclude current post from top posts
-
Hi,
Thanks for this awesome plugin, it’s really one of a kind and so useful.
I’m using the widget on the bottom of my articles to show most popular posts for a given time period, and it works great. Though, I wanted to exclude the current post from top posts so it wouldn’t be redundant to the user. This is the code I’m using:
[google_top_content pageviews=5 number=6 showhome=no time=604800 timeval=1 thumb_size=medium postfilter='. $post->ID .']
This works great and does what I need, but there’s a small problem. There are now tons of unique transients being created. And since almost every post has its own transient, this has a negative impact on response time because of all the requests being made to Google Analytics (and it kind of defies the purpose of transients altogether).
I think a better solution would be to only remove the current post if it’s a popular post (and not from all posts) and use the same transients for the rest. The only thing is, I have no idea if this is feasible with your plugin, and if so, how one could code it.
If you think there’s a way to exclude the current post only if it’s one of the popular posts, I would happily like to know.
Thank you,
Janvitos
- The topic ‘Exclude current post from top posts’ is closed to new replies.