Add an Ribbon to featured ads (vers. 3.1.8)
Goal of this tutorial is to show a ribbon on the featured ads listings. Tested on Classipress
Version 3.1.8 Something like this in the screenshot:
[CENTER]
featured-ribbon.jpg[/CENTER]
Please backup the following files which can all be found in
/wp-content/themes/classipress/
loop-ad_listing.php
loop-featured.php
style.css
Done? Ok, lets start:
1.)
Open the
loop-ad_listing.php and find the following code (line 21)
PHP Code:
<div class="post-block">
UNDER the above code add the following code:
PHP Code:
<?php if(is_sticky($post_ID) == true) echo '<span class="featured-ribbon"></span>'; else echo ''; ?>
save the file.
__________________________________________________ __________________________________________________ _____
2.)
Open the
loop-featured.php and find the following code (line 26)
PHP Code:
<div class="post-block">
UNDER the above code add the following code:
PHP Code:
<?php if(is_sticky($post_ID) == true) echo '<span class="featured-ribbon"></span>'; else echo ''; ?>
save the file.
__________________________________________________ __________________________________________________ _____
3.)
Open the
style.css and add the following code under the last line:
PHP Code:
/* Featured Ribbon */
.featured-ribbon{
display:block;float:left; height:60px;margin:-18px 0px 0px -18px;padding:0;width:60px;
position:absolute;
background:url("images/featured.png") no-repeat scroll right top transparent; z-index:999;
}
save the file.
__________________________________________________ __________________________________________________ _____
4.)
Copy and save the following image or create your own:
featured.png
Save that image in
/wp-content/themes/classipress/images/
__________________________________________________ __________________________________________________ _____
5.)
Enjoy your Ribbon and drink a beer
Greets