Results 1 to 1 of 1

Thread: Prevent ads marked as Sold from Displaying on Classipress 3.6.0

  1. #1
    Thread Starter
    Expired Customer steventing's Avatar
    Join Date
    Aug 2017
    Posts
    2
    Thanks
    1
    Thanked 1 Time in 1 Post

    Prevent ads marked as Sold from Displaying on Classipress 3.6.0

    This is information that I gathered from other threads but were a couple of years old. I am using Classipress 3.6.0

    To remove Sold ads from displaying on the main page, you will edit content-ad_listing.php. You can do similar things to content-slider-ad_listing.php if you are using Feature Ads.

    You will add the following code before the first <div>
    Code:
    <?php if ( get_post_meta($post->ID, 'cp_ad_sold', true) !== 'yes' ) : ?>
    And you will add the following code at the end of the file after the last </div>
    Code:
    <?php endif; ?>
    This is what my final code looks like.

    Code:
    <?php
    /**
     * Listing loop content template.
     *
     * @package ClassiPress\Templates
     * @author  AppThemes
     * @since   ClassiPress 3.4
     */
    global $cp_options;
    ?>
    <?php if ( get_post_meta($post->ID, 'cp_ad_sold', true) !== 'yes' ) : ?>
    <div class="post-block-out <?php cp_display_style( 'featured' ); ?>">
    
    	<div class="post-block">
    
    		<div class="post-left">
    
    			<?php if ( $cp_options->ad_images ) cp_ad_loop_thumbnail(); ?>
    
    		</div>
    
    		<div class="<?php cp_display_style( array( 'ad_images', 'ad_class' ) ); ?>">
    
    			<?php appthemes_before_post_title(); ?>
    
    			<h3><a href="<?php the_permalink(); ?>"><?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ) . '...'; else the_title(); ?></a></h3>
    
    			<div class="clr"></div>
    
    			<?php appthemes_after_post_title(); ?>
    
    			<div class="clr"></div>
    
    			<?php appthemes_before_post_content(); ?>
    
    			<p class="post-desc"><?php echo cp_get_content_preview(); ?></p>
    
    			<?php appthemes_after_post_content(); ?>
    
    			<div class="clr"></div>
    
    		</div>
    
    		<div class="clr"></div>
    
    	</div><!-- /post-block -->
    
    </div><!-- /post-block-out -->
    <?php endif; ?>

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Ad has been marked as sold
    By bighenry in forum ClassiPress General Discussion
    Replies: 3
    Last Post: February 27th, 2013, 11:36 AM
  2. [SOLVED] marked as Sold ?
    By omerknet in forum Report ClassiPress Bugs
    Replies: 6
    Last Post: January 19th, 2013, 09:41 PM
  3. [MOD NEEDED] marked as code for ads sold
    By quim in forum ClassiPress General Discussion
    Replies: 2
    Last Post: August 12th, 2011, 04:29 PM