wordpress sidebar widget issue

Discussion in 'WordPress' started by bbrian017, Oct 15, 2010.

  1. #1
    Hello,

    Do you know how to fix the way your module looks for me?

    See in the bottom of the sidebar.

    http://www.blogengage.com/blogger/

    I don't know how to make it fit right could you help?

    This is a great plugin for my guest bloggers to promote their selves.

    This is the php file,

    <?php
    /*
    Plugin Name: Latest Contributors
    Plugin URI: http://www.famousbloggers.net/
    Description: Latest contributors plugin will add a new widget to your Wordpress, it will allow you to display a list of contributors avatars linking to their blogs/sites.
    Author: Hesham Zebida
    Version: 1.0
    Author URI: http://www.famousbloggers.net/
    */
    function lcontributors_widget() {
    $authors =  array();
    $count = 0;
    $args=array(
      'post_type' => 'post',
      'post_status' => 'publish',
      'posts_per_page' => -1,
      'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      echo '<div class="authors_list"><h3>Latest Contributors</h3><br /><ul>';
      while ($my_query->have_posts() && $count < 36) : $my_query->the_post();
        $author_id=$my_query->post->post_author;
        $user = new WP_User( $author_id );
        if ( !empty( $user->roles ) && is_array( $user->roles ) && in_array('contributor',$user->roles) ) {
          if (!in_array($author_id,$authors)) {
            echo '<li>';
            ?>
    		<a rel="external" href="<?php the_author_meta('user_url'); ?>" title="<?php the_author_firstname(); ?>"><?php echo get_avatar( get_the_author_id() , 32 ); ?></a>
    		<?php
            //the_author_posts_link();
    		echo '</li>';
            $count++;
            $authors[]=$author_id;
          }
        }
      endwhile;
    }
    wp_reset_query();  // Restore global post data stomped by the_post().
    echo '</ul></div>';
    }
    function init_lcontributors(){
    	register_sidebar_widget("Latest Contributors", "lcontributors_widget");     
    }
    add_action("plugins_loaded", "init_lcontributors");
    function add_lcontributors_style(){ ?>
    <link rel="stylesheet" href="<?php bloginfo('url'); ?>/wp-content/plugins/wp-latest-contributors/style.css" type="text/css" media="screen, projection" /> 
    <?php
    }
    // adding styles
    add_action('wp_head', 'add_lcontributors_style');
    ?>
    Code (markup):
    This is the css file

    /*
    File:			style.css
    Description:	Custom style for Latest Contributors with Avatar Widget
    */
    
    #sb_gp_box {overflow:hidden;width:300px; padding-bottom:20px;}
    #sb_gp_box .sb_gp_thumbs a:hover {/* background-color: #000;  color:#dcd9d9;*/}
    .custom #sb_gp_box ul li {list-style-image: none; list-style:none; height:35px;padding-bottom:10px;}
    .sb_gp_thumbs {float:left; font-size:12px; padding-bottom:0px; padding-top:5px;}
    .sb_gp_thumbs a { text-decoration:none; }
    .sb_gp_thumbs a:hover { color:#000;text-decoration:none;}
    .sb_gp_thumbs li { clear:both; height:45px; width:265px; display:block; float:left; list-style:none; list-style-image: none; padding-top:10px;}
    .sb_gp_pen {}
    .sb_gp_avatar {float:left; margin-right:10px;}
    .sb_gp_avatar img {border:2px solid #FFF;}
    .sb_gp_avatar img:hover {border:2px solid #CCC;}
    .sb_gp_title {margin-right:10px;}
    .sb_gp_comments {}
    .sb_gp_comment_img { margin-top:2px;}
    
    
    /* Latest contributors list */
    .authors_list ul {padding-top:10px;}
    .authors_list li { float:left; padding-left:10px; padding-bottom:10px;}
    .authors_list img { border:2px solid #a7acaa;}
    .authors_list img:hover { border:2px solid #FFF;}
    Code (markup):
     
    bbrian017, Oct 15, 2010 IP
  2. seogawd

    seogawd Active Member

    Messages:
    315
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #2
    why dont you just drop a plugger in?
     
    seogawd, Oct 15, 2010 IP
  3. professional_designer

    professional_designer Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes you need plugin!!
     
    professional_designer, Oct 15, 2010 IP