I have made a few changes to the plugin.
Hi.
On my site I did not wan't to use the slider on the front page. In stead I wanted to use it on the category pages as well as on tag pages and search.
I have reserved the front page of my site to include a different slider in order to draw users to the blog posts.
So instead of adding the slider to the tpl-ads-home.php file, I placed it in:
taxonomy-ad_cat.php
taxonomy-ad_tag.php
search.php
It works, pretty well, but I discovered that the plugin is not optimized for these theme locations.
The plugin would search for all featured ads across ad categories, thereby giving not so great results for the user who are browsing more specific ads.
Another thing I noticed, was that the plugin reads all posts, and then filters those out who does not have an image.
And it altered the original query using query_posts(), which is not recommended because of performance.
In short
- It can't select ads with images, but have to select all ads and then filter out the ads without images.
- It is not limited by the selected categories.
- The plugin use the query_posts(), which executes the main query twice.
Number 1 is a design flaw in wordpress, because images are just attachements, You can not create query to the database that can search for image attachments. However it is possible to create a query that search for a featured image on the post. So in order to be able to handle this, all you have to do is to make sure that your posts always creates a featured image, if the ad is created with a post.
This can be handled if you install a plugin like the "Auto Post thumbnail" You can configure that to always make sure that a post of a given post type has a featured image. I honestly do not understand why this is not a standard feature of classipress, but it is not.
With that plugin installed I was able to alter the query and only select between posts with images, thereby limiting the load on the database
Number 2 can be handled by finding the ad categories of the ads being displayed on the page, and then ad a taxonomy query to the post query.
Number 3 was an easy fix, instead of using the query_posts, I created a sub query, only for the seven posts needed to select the featured ads.
Since this is a purchased plugin, I can not post the code here, but I would be happy to send the changes to the plugin author if he would like.