Need help reverting back a mod to Price Tags showing in ads
My request for help in the MultiPort Forum isn’t getting any traction so let me try here.
I have the latest version of WordPress, Classipress and the MutliPort child theme installed. Mutiport has a feature to remove the price tag from the ad if the cp_price field is equal to 0 or is text.
Prior to installing MultiPort, I could put the text, like the word “Trade” in the cp_price field and it would appear in the price tag like this, “$Trade” which is fine, I can live with the $ sign.
Additional digging showed a Samcy mod that implemented this feature (without buying Multiport) and the code is below.
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"> </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
}
When I comment out this code in MultiPort funtions.php, I get lots of forward slashes in the left and right top corners of the page along with a partial price tag graphic in the top left corner and more forward slashes (the same forward slashes you use to comment out code).
On the plus side, the price tag graphics accept text like I want. If anyone can help me out here it would be greatly appreciated. Like I said, I'm close but at a loss as to how to make this work like it did pre-MultiPort.
I would really love to get this working if someone could help me with the code.
If you can fix this but want to be compensated for your help, message me with a price. I want this changed today.