Remove ad hits counter on front page
Showing ad hits on ad listing can slow down your site and drastically increase processor usage when reading this data from database, because this data is not stored aggregated in a database.
This feature should be switched off if you are not cleaning old data from daily_counters table.
If your site has a lot of visitors, then this feature will use lot of CPU time to calculate daily totals, since this table can become huge, and making 30 selects (10 per tab on front page) for every visitor, you will soon get a call from your hosting service to reduce CPU usage.
With this mod you will remove ad hits counter ad listing page, but it will remain on single ad view.
This mod is very simple, all you have to do is add some code to actions.php which is located in includes folder of your Classipress instalation.
Please make a backup of your file before doing any changes.
Step 1
Open the file mentioned before and locate this code:
function cp_do_loop_stats() { global $post, $cp_options; |
Then add this code after it:
if ( !is_single() ) return; |
Aditional note:
If you would like to display counters on Main Page and not on Single Ad Page then your code should be like this:
if ( is_single() ) return; |
That’s all.
If you find any issues with this tutorial, please be so kind and write a comment. I’ll try to help as much as I can.
Hi Bro, How to remove the ad hits in Single Ad Page
To remove counters from Single Ad Page and from Main page you should do this from Settings.
Go to Classipress->Settings->Listings. There you will find “Show Ad Views Counter” and turn it off.
If you want to remove counters only from Single Ad Page then check this tutorial. I have added additional note how to do that.
Remove Category Ad count not from the settings ?
I have removed the category ad count, under the classipress settings, so when you visit the home page you can NOT see the ad count, BUT once I click on the category, it shows the ad count again beside the category name. Please tell me how to remove it ? Thanks
Open file taxonomy-ad_cat.php and remove unnecessary code from the line
Hi Blaz,
How to Hide Dashboard Views.
Thanks.
Hi Lin,
Could you be more specific? I haven’t noticed any Dashboard counter.
Please see the image
http://postimg.org/image/5lv1dl2nj/
Thanks.
I’m using version 3.4.1
I have created a new post on this topic. Please refer to this post