ovidiubica (July 23rd, 2018)
<?php/**
Plugin Name: Remove Price Tag
Plugin URI: http://cytaweb.com/
Description: Remove the price tag for listings that don't need a price
Version: 1.0
Author: Samcy (Rolf Hassel)
Author URI: http://cytaweb.com/
*/
// 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)){
?>
<div class="tags price-wrap">
<span class="tag-head">
<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>
</span>
</div>
<?php
} else { ?>
<?php
}
}
add_action( 'appthemes_before_post_title', 'cp_remove_loop_price' );
?>
ovidiubica (July 23rd, 2018)
There are currently 1 users browsing this thread. (0 members and 1 guests)