Page 1 of 6 123 ... LastLast
Results 1 to 10 of 54
Like Tree5Likes

Thread: Remove Price Tag for ads without a price or ZERO (0)

  1. #1
    Thread Starter
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts

    Thumbs up Remove Price Tag for ads without a price or ZERO (0)

    Hello all ClassiPress admins,

    Sometimes we don't need a price tag to show up at all. That could be listings for Relationships, Datings, Job offers, Information ads, Free give aways, etc etc...

    And to see a short and empty price tag is also not nice. So let's remove that price tag when it's not needed. I give you two options to get this job done:


    Option 1: You are running a child theme and got a functions.php?


    Open that functions.php and add the following code:

    Code:
    // Unhook default ClassiPress functions
    function unhook_classipress_functions() {
        remove_action( 'appthemes_before_post_title', 'cp_ad_loop_price' );
    }
    add_action('init','unhook_classipress_functions');
    
    function cp_remove_loop_price() {
        if ( is_page() ) return; // don't do ad-meta on pages
        global $post;
          if ( $post->post_type == 'page' || $post->post_type == 'post' ) return;
          $price = get_post_meta($post->ID, 'cp_price', true); 
          if (!empty($price) AND ($price>0)){
    ?>        
        <div class="price-wrap">
           <span class="tag-head">&nbsp;</span><p class="post-price">
        <?php if ( get_post_meta( $post->ID, 'price', true ) ) cp_get_price_legacy( $post->ID );
         else cp_get_price( $post->ID, 'cp_price' ); ?></p>
            </div>
     <?php
    } else { ?>
     <?php
    }
    }
    add_action( 'appthemes_before_post_title', 'cp_remove_loop_price' );
    Option 2: You don't have a child theme and you are to lazy to modify files:

    Install it as a free plugin (download the remove-price-tag.zip attachment)

    Demo: www.cytaweb.com

    Enjoy!
    Attached Files Attached Files
    echo08, vjlamba, trehahn and 1 others like this.
    Rolf Hassel (Samcy)

  2. The Following 17 Users Say Thank You to samcy For This Useful Post:

    arthurganem (January 4th, 2013), barry (December 22nd, 2012), cozmuler (May 6th, 2014), echo08 (June 13th, 2013), Fanatic (December 6th, 2012), firstnet2 (January 11th, 2013), masrmotors (September 6th, 2012), merekhia (October 31st, 2012), muellerjoel (November 24th, 2015), ngetikcom (September 6th, 2012), resellgalore (June 6th, 2014), spex (January 2nd, 2013), steely (July 24th, 2013), valance (October 22nd, 2012), vjlamba (November 28th, 2013), weiching (September 7th, 2012), wzshop (October 5th, 2015)

  3. #2
    masrmotors's Avatar
    Join Date
    Aug 2012
    Location
    Egypt
    Posts
    8
    Thanks
    5
    Thanked 3 Times in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    Thread Starter
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  5. #4
    Veteran weiching's Avatar
    Join Date
    Apr 2011
    Posts
    505
    Thanks
    85
    Thanked 43 Times in 38 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    Senior Member matt9250's Avatar
    Join Date
    Jan 2011
    Location
    Texas
    Posts
    180
    Thanks
    19
    Thanked 5 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #6
    Thread Starter
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  8. #7
    jobastian's Avatar
    Join Date
    Sep 2012
    Location
    Australia
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #8
    thusinh's Avatar
    Join Date
    Sep 2012
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Demo site has nice feature...HOW ? Thanks !

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

  10. #9
    jlhwebs's Avatar
    Join Date
    May 2012
    Location
    United States
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #10
    Senior Member matt9250's Avatar
    Join Date
    Jan 2011
    Location
    Texas
    Posts
    180
    Thanks
    19
    Thanked 5 Times in 5 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Attached Images Attached Images

Page 1 of 6 123 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [MOD NEEDED] Remove price tag for only $0 ads
    By citydealz in forum ClassiPress General Discussion
    Replies: 85
    Last Post: March 1st, 2017, 10:44 AM
  2. Remove price tag
    By sellyourskill in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: May 29th, 2011, 12:57 PM
  3. [SOLVED] remove price tag
    By sumaxx in forum ClassiPress General Discussion
    Replies: 6
    Last Post: December 30th, 2010, 03:32 AM
  4. Pricing Structure -- % of Sellers ad Price & Fixe Price per Ads
    By tech9 in forum ClassiPress General Discussion
    Replies: 2
    Last Post: December 28th, 2010, 02:38 PM