• This is a full-featured replacement for the bundled WordPress ‘latest posts’ widget. Unfortunately, this plugin doesn’t have the line separators that the WordPress widget makes (which it should), so I tweaked some code to fix that:

    <div class="scpcontainer<?php echo $lastcont; ?>">
      <ul>
        <?php
              $scporder = array();
              $feat_image = '';
              $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
              $pluginurl = site_url('/wp-content/plugins/simple-seo-categories-posts/timthumb.php');
              if ($displthumb == 'displthumb' && $feat_image != '') { // get thumb
              $scporder[$thumborder] = '
              <div class="scpthumb">
                <a href="'. get_permalink($post->ID) .'" title="'. get_the_title($post->ID) .'">
                <img src="'. $pluginurl .'?src='. $feat_image .'&w='. $thumbwidth .'&h='. $thumbheight .'&zc='. $thumbcrop .'" width="'. $thumbwidth .'" height="'. $thumbheight .'" title="'. get_the_title($post->ID) .'" alt="'. get_the_title($post->ID) .'" />
                </a>
              </div>
              ';
              }
              if ($disptitle == 'disptitle') { // get title
                $scporder[$titleorder] = '
                <li>
    			<div class="scptitle">
                  <a href="'. get_permalink($post->ID) .'" title="'. get_the_title($post->ID) .'">'. get_the_title($post->ID) .'</a>
                </div>
    			</li>
                ';
              }
              if ($dispdate == 'dispdate') { // get date
                $scporder[$dateorder] = '<div class="scpdate">'. get_the_date() .'</div>
                ';
              }
              if ($dispauthor == 'dispauthor') { // get date
                $scporder[$authororder] = '<div class="scpauthor">'. $beforeauthor .get_the_author_link() .'</div>
                ';
              }
              if ($exclength > 0 && $displexc == 'displexc') { // get excerpt
                $scporder[$excorder] = '<div class="scptext">'. scpexcerpt($exclength) .'</div>';
              }
              if ($exclength == 0 && $displexc == 'displexc') {
                $scporder[$excorder] = '<div class="scptext">'. get_the_excerpt() .'</div>';
              }
              ksort($scporder);
              foreach ($scporder as $scpkey => $scpoutput) {
                echo $scpoutput;
              }
            ?>
      </ul>
    </div>
  • The topic ‘Very good Widget plugin, but needed some tweaks’ is closed to new replies.