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 thewp_days_ago
tag to all the other tags, not replace them.I have tried passing
wp_days_ago
topost_class
as 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.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to put wp_days_ago inside class element?’ is closed to new replies.