How to display an icon when a new post is published and then remove it when a specific time past?

Filter the content of post_class(): add_filter( ‘post_class’, function( $classes ) { if ( is_singular() ) return $classes; // now minus last mod time in seconds $diff = time() – mysql2date( ‘U’, $post->post_date ); if ( DAY_IN_SECONDS <= $diff ) $classes[] = ‘new-post’; return $classes; }); Now, in your loop, use post_class(), and you get an … Read more

Shown icon if old

Just flip the “less than” < to “greater than” >: <?php if ( date( ‘U’ ) – get_the_time( ‘U’, $post->ID ) > DAY_IN_SECONDS ) : ?>Old Post<?php endif ?> http://codex.wordpress.org/Easier_Expression_of_Time_Constants

social icons not showing

I’m still not sure on the process you used, but here is what i suggest: find out what plugin is using the social and re-install it. TO AVOID WORDPRESS INTERACTIONS: To avoid wordpress interaction and just make changes to the database, this is what i suggest: start over with the process. (not completely necessary, you … Read more

Hide icon and rating when there is no rating entered

Simply check that the rating is not empty before printing the markup you wish to make conditional: <?php $rating = get_average_listing_rating( $post->ID, 1 ); if ( ! empty( $rating ) ) { ?> <span class=”js-average-rating”><i class=”star”></i> <?php echo $rating; ?></span> <?php } ?> Without seeing this in context, it’s possible you need the outer span … Read more