Results 1 to 3 of 3

Thread: archive-ad-listing.php add featured function

  1. #1
    Thread Starter
    Expired Customer bidakkabi's Avatar
    Join Date
    Mar 2018
    Posts
    99
    Thanks
    10
    Thanked 1 Time in 1 Post

    archive-ad-listing.php add featured function

    How to run Posting Base URL too
    All Ads
    it just doesn't work there


    HTML 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( array( APP_TAX_CAT, APP_TAX_TAG ) ) || 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

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,704
    Thanks
    166
    Thanked 3,390 Times in 3,261 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    Thread Starter
    Expired Customer bidakkabi's Avatar
    Join Date
    Mar 2018
    Posts
    99
    Thanks
    10
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] No featured image on listings archive page
    By dutchman in forum Help Using Vantage
    Replies: 7
    Last Post: June 24th, 2020, 08:45 PM
  2. Listing picture not aligned correctly on listing archive page.
    By sexd in forum Help Using Vantage (Legacy)
    Replies: 3
    Last Post: August 23rd, 2014, 05:52 AM
  3. Ad Listing Archive Widget
    By agokeefe in forum Logic Widgets
    Replies: 1
    Last Post: May 6th, 2014, 02:59 AM
  4. Title in Archive Listing
    By neowebmedia in forum Vantage General Discussion (Legacy)
    Replies: 2
    Last Post: March 29th, 2014, 04:44 PM
  5. Title in Archive Listing
    By neowebmedia in forum Report Vantage Bugs (Legacy)
    Replies: 1
    Last Post: June 13th, 2012, 10:56 AM