Add a "sold-tag" in ad-listing and a "sold-stamp" in ad-description (cp Vers. 3.1.8)
No comments about my poor english please...
In this tutorial I show how to add a "sold-tag" in the ad-listing and a "sold-stamp" inside the ad description.
Tested with Classipress 3.1.8
Lets start with a step-by-step tutorial for those who want to do the changes by themself. Our goal is to get it like in the following pics:
[CENTER]The Sold-Tag:
soldtag318.jpg
The Sold-Stamp:
soldstamp318.jpg[/CENTER]
We need to modify 3 php files which you can find in
/wp-content/themes/classipress/ The files are:
- loop-ad_listing.php
- loop-featured.php
- single-ad_listing.php
Please first make a backup of those files! Done? OK, lets continue:
1.)
Open the
loop-ad_listing.php and go to line 34, find this code:
PHP Code:
<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>
Replace above code with this code:
PHP Code:
<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>
<span><?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?>
<img src="/wp-content/themes/classipress/images/sold_tag.png"></span>
<?php endif; ?></h3>
save the file.
__________________________________________________ ________________________
2.)
Open the
loop-featured.php and go to line 38, find this code:
PHP Code:
<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>
Replace above code with this code:
PHP Code:
<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>
<span><?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?>
<img src="/wp-content/themes/classipress/images/sold_tag.png"></span>
<?php endif; ?></h3>
save the file.
__________________________________________________ ___________________
3.)
Open the
single-ad_listing.php and go to line 88, find this code:
PHP Code:
<li id="cp_sold"><span><?php _e('This item has been sold', 'appthemes'); ?></span></li>
Replace above code with this code:
PHP Code:
<li id="cp_sold"><span><img src="/wp-content/themes/classipress/images/stamp-sold.gif"></span></li>
save the file.
__________________________________________________ _____________________
4.)
Copy (or create your own) the following images and upload them to:
/wp-content/themes/classipress/images/
sold_tag.png
stamp-sold.gif
__________________________________________________ ______________________
5.)
Enjoy and drink a beer
If someone does not like to do the changes by himself, ask me here and i give you the ready changed files which you only have to upload to your folder.
Thanks for reading and best regards
Samcy