How to put wp_days_ago inside class element?
Hi. I was trying to use this plugin to style posts differently according to their age. So I put the output of the template tag inside class element and tweak the CSS. For example, this works:
<h3 class="<?php wp_days_ago(1); ?>">
The problem is with post elements that use
post_class. I want to add the
wp_days_agotag to all the other tags, not replace them.
I have tried passing
post_classas a parameter, but the result is something like ‘todayclass=”post”‘, instead of ‘class=”post today”‘.
I’ve been trying with
get_post_class, but I know little PHP and all I can get is either ‘Array’ or ‘Array(key > value)’, instead of ‘value value value’.
I’d be grateful if anyone could do any suggestion.
- The topic ‘How to put wp_days_ago inside class element?’ is closed to new replies.