Results 1 to 7 of 7

Thread: Badges Appearing in Latest Listings Widget?

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

    Badges Appearing in Latest Listings Widget?

    How can I VIP badges appear for the Latest Listings widget please?

    PHP Code:
    function my_cp_add_listing_item_featured() {

        
    // Only show on archive pages.
        // Category, Author, Listing Post Types, Listing Search, etc.
        
    if ( ! is_archive() ) {
            return;
        }

        
    // Change the list of addons according to your case.
        // NOTE: get the Addon type on the addon page under the Slug box.
        
    $addons_types = array(
            
    'ad_listing-highlight'  => __'Highlight''yourdomain' ),
            
    'ad_listing-vip'        => __'VIP''yourdomain' ),
            
    'ad_listing-urgent'     => __'Urgent''yourdomain' ),
            
    'ad_listing-good-price' => __'Good Price''yourdomain' ),
            
    'ad_listing-tipp'       => __'Tipp''yourdomain' ),
            
    'ad_listing-featured'   => __'Featured''yourdomain' ),
        );

        
    $labels '';

        
    // Go through all addons above and add a label HTML.
        
    foreach ( $addons_types as $addon_type => $label ) {
            if ( 
    appthemes_has_addonget_the_ID(), $addon_type ) ) {
                
    $labels .= '<span class="featured-label label featured-label-' $addon_type '">' $label '</span>';
            }
        }

        if ( ! empty( 
    $labels ) ) {
            echo 
    html'div class="featured-label-wrap" style="position:absolute;top:0;line-height:0.9;"'$labels );
        }

    }
    add_filter'cp_listing_item_head''my_cp_add_listing_item_featured'); 

    Add it to appropriate Addon setting or in the Additional CSS section of the Customizer:

    Code:

    Code:
    .featured-label.featured-label-ad_listing-highlight {
        position:initial;
        background: #F8AC59;
        color: #FEFEFE;
        margin-right: 5px;
    }

  2. #2
    Marketplace Seller dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,226
    Thanks
    89
    Thanked 595 Times in 493 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
    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
    Marketplace Seller dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,226
    Thanks
    89
    Thanked 595 Times in 493 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
    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!

  6. #6
    Thread Starter
    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!

  7. #7
    Marketplace Seller dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,226
    Thanks
    89
    Thanked 595 Times in 493 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: 0
    Last Post: August 15th, 2020, 01:39 AM
  2. Replies: 1
    Last Post: September 22nd, 2019, 02:37 AM
  3. the Latest Listings widget settings ClassiPress 4.0.0
    By oachour in forum ClassiPress General Discussion
    Replies: 0
    Last Post: July 20th, 2018, 01:46 PM
  4. Replies: 5
    Last Post: January 26th, 2018, 02:49 AM
  5. [TUTORIAL] Latest Ad Listings On Blog Sidebar widget
    By hugo in forum ClassiPress General Discussion
    Replies: 5
    Last Post: April 2nd, 2011, 02:38 PM