Results 1 to 6 of 6

Thread: Featured Ad Bug

  1. #1
    Thread Starter
    Expired Customer neunited's Avatar
    Join Date
    Jun 2020
    Posts
    59
    Thanks
    1
    Thanked 3 Times in 3 Posts

    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'), 112);
        }


        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?

  2. #2
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,236
    Thanks
    89
    Thanked 597 Times in 495 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    arthemes.org - AppThemes plugins, tutorials, modifications and services

  3. #3
    Thread Starter
    Expired Customer neunited's Avatar
    Join Date
    Jun 2020
    Posts
    59
    Thanks
    1
    Thanked 3 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,236
    Thanks
    89
    Thanked 597 Times in 495 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    arthemes.org - AppThemes plugins, tutorials, modifications and services

  5. #5
    Thread Starter
    Expired Customer neunited's Avatar
    Join Date
    Jun 2020
    Posts
    59
    Thanks
    1
    Thanked 3 Times in 3 Posts

    VIP Ad Bug

    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,236
    Thanks
    89
    Thanked 597 Times in 495 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    arthemes.org - AppThemes plugins, tutorials, modifications and services

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 17
    Last Post: December 2nd, 2019, 08:27 AM
  2. Replies: 1
    Last Post: August 5th, 2014, 05:01 AM
  3. Replies: 7
    Last Post: December 4th, 2013, 09:23 AM
  4. Featured posts in Vantage Search results are not.. featured?
    By znassif in forum Report Vantage Bugs (Legacy)
    Replies: 11
    Last Post: September 27th, 2012, 09:06 PM