Support » Plugin: TW Recent Posts Widget » Styling the "sticky" posts differently? Date selection for stale news?

  • It is nice that the plugin picks up the posts tagged “sticky” and lists them at the top.
    I would like to draw the user’s attention more explicity to these.

    Unfortunately, I don’t think it’s just a matter of styling the css, as the entry appears to be classed the same as “regular” ones.
    Any hope you could add some specific identifyier?

    While I’m on suggestions/requests, could we also have a date limit on the listed entries to avoid “stale” news?
    I would like to be able to specify things like : “list no more than 10 entries, not older than 45 days old.”

    https://wordpress.org/plugins/tw-recent-posts-widget/

Viewing 1 replies (of 1 total)
  • FWIW, for styling the stickies differently, I hacked the following patch :
    ./wp-content/plugins/tw-recent-posts-widget/tw-recent-posts-widget.php

    while($wp_query->have_posts()) : $wp_query->the_post();
    
    	// Check for the "sticky" tag, and if present, add the sticky class to that div
    	$all_the_tags = get_the_tags();
    	$class='featured-post';
    	if ($all_the_tags) {
    		foreach($all_the_tags as $this_tag) {
    			if ($this_tag->name == "sticky" ) {
    				$class='featured-post sticky';
    			}
    		}
    	}
    ?>
    	<div class="<?php echo $class;?>">

    and then :
    ./wp-content/plugins/tw-recent-posts-widget/tw-recent-posts-widget.css

    .tw-recent-posts .featured-post.sticky {
    	background-color: #ffffb3;	/* post-it color */
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Styling the "sticky" posts differently? Date selection for stale news?’ is closed to new replies.