Hi guys,
I would like to install a “new”-badge in my listing hive theme, displaying on ads which are <=60 days. I have tried this one:
function anzeigen_neu_badge( $content ) {
if ( is_singular(‘listing’) && get_the_time(‘U’) > strtotime(‘-60 days’) ) {
$content = 'NEU ’ . $content;
}
return $content;
}
add_filter( ‘the_content’, ‘anzeigen_neu_badge’ );
function anzeigen_neu_badge_css() {
echo ‘.neu-badge { background-color: #ff0000; color: #fff; padding: 5px; border-radius: 4px; font-size: 12px; }’;
}
add_action( ‘wp_head’, ‘anzeigen_neu_badge_css’ );
by using snippets, but doesn’t work.
Anyone an idea how to fix this issue?
Thanks in advance!
Sebastian