Add a "Sold Tag" classified to the "Ad listing" and "loop Description" of the ad
Add a "Sold Tag" classified to the "Ad listing" and "loop Description" of the ad
I hope they understand what I write, I speak Spanish and the translated probably not good, greetings to the comuidad of ClassiPress
I decided to make this tutorial because it did not understand the explanation given in the tutorials and achieves collecting information from several.
The implementation is for all versions of ClassiPress, I probe from the 3.1 and now I use it in version 3.9
It works for all versions of ClassiPress if you follow the exact steps.
single-ad_listing.php and loop-ad_listing.php
single-ad_listing.php
image2.jpg
<?php
} else {
if ( get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes' ) : ?>
<li id="cp_ad_sold"><span><img src="http://your-site.com/your-folder/ejemplo.png"></span></li>
<?php endif; ?>
<?php
// 3.0+ display the custom fields instead (but not text areas)
cp_get_ad_details( $post->ID, $cat_id );
?>
Agree in style.css
.cp_ad_sold {
width: 72px;
height: 72px;
position: relative;
margin-left:-8px;
margin-top:-10px;
}
Loop-ad_listing.php In this case, copy the code from the beginning to the modified line and add a line over the original so they know where they have to paste the code.
image1.jpg
<?php
/**
* Main loop for displaying ads
*
* @package ClassiPress
* @author AppThemes
*
*/
?>
<?php appthemes_before_loop(); ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php appthemes_before_post(); ?>
<div class="post-block-out">
<div class="post-block">
<div class="post-left">
<?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?><div class="post-sold-rb"></div>
<?php endif; ?>
<?php if ( get_option('cp_ad_images') == 'yes' ) cp_ad_loop_thumbnail(); ?>
Agree in style.css
.post-sold-rb {
width: 72px;
height: 72px;
position: absolute;
background: url(http://your-site/your-folder/ejemplo2.png) no-repeat;
margin-left:-8px;
margin-top:-10px;}
In both cases you need to create a folder with the name you want and replace the code of your-folder by the folder where files will accommodate both.
It is necessary to the creation of two files with termination png. one for the list of ads and the other for full description of the ad.
Both keep you in the folder you created on your server, or where the lodge you. preferred to do it this way because if kept png files in the directory of images ClassiPress, did not work, so I decided to create the folder and specify the full path to the location of the files.
Example: /public_html/your-folder/
In style.css lines added in post-sold-rb and can be modified cp_ad_sold width height margin since everyone is going to create a png file of different proportions then can adjust the position
I hope this tutorial will be helpful and I thank the users who made Appthemes tutorials which I read and I could successfully implement the function, Greetings Andres.