WordPress.org

Ready to get started?Download WordPress

Forums

Simple Category Posts
Very good Widget plugin, but needed some tweaks (1 post)

4 stars
  1. Das Capitolin
    Member
    Posted 1 year ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.