Featured Ad Bug
Hi I recently purchased CP addons and I'm using Classipress 4.2.x
Pointing to discussion
https://forums.appthemes.com/cp-addo...hlight-103506/
I used the addon with slug "vip" to make ads appear on the standard ClassiPress featured slider.
1. So, take the VIP addon
2. Enable option "Show on Top" to make it work like "Premium"
3. Add styles to highlight it - copy from Highlight addon and rename classes from highlight to vip
However the new VIP ads appear at the bottom of featured listings due to a previous bug fix in code snippets:
PHP Code:
//Stick featured ads to the top on category and search pages
class StickyAds {
public function __construct() {
add_filter('posts_orderby', array($this, '_hookPostsOrderBy'), 11, 2);
}
public function _hookPostsOrderBy($orderBy, $query) {
global $wpdb;
if ( is_tax('ad_cat') || is_search() && !$query->query_vars['ignore_sticky_posts']) {
$stickyPosts = get_option('sticky_posts');
if (is_array($stickyPosts) && !empty($stickyPosts)) {
$sticky = '(' . $wpdb->posts . '.ID IN (' .
implode(',', $stickyPosts) . ')) DESC';
$orderBy= empty($orderBy) ? $sticky : $sticky . ',' . $orderBy;
add_filter('pre_option_sticky_posts', array($this, '_hookOptionStickyPosts')
);
}
}
return $orderBy;
}
public function _hookOptionStickyPosts($option) {
remove_filter('pre_option_sticky_posts', array($this, '_hookOptionStickyPosts')
);
return array();
}
}
$stickyads = new StickyAds();
// End sticky ads
Can you help please?