WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a wordpress site and need to have a widget on the sidebar which has thumbnails, but links to URLs specified per thumbnail rather than the images. It seems simple, but I can't find any plugin to do it in a way a non-developer can from the admin panel.

Currently the NextGEN gallery plugin is being used. Is there any way to configure that, or any similar plugin, in that manner?

How hard would it be to build a plugin from scratch to achieve this, and do you think that's necessary?

share|improve this question
up vote 0 down vote accepted

You could create your own widget that queries posts from a certain category then displays the_post_thumbnail in an unordered list linking to the post.

Example widget (add to functions.php):


class c3m_thumbnail_posts extends WP_Widget {

function c3m_thumbnail_posts() {
$widget_ops = array( 'classname' => 'thumbnail-posts', 'description' => 'Displays post thumbnails' );
$control_ops = array( 'id_base' => 'c3m-post-thumbnail' );
$this->WP_Widget( 'c3m-post-thumbnail', 'Post Thumbnail Widget', $widget_ops, $control_ops );
function widget( $instance ) {
echo $before_widget;
<h2>Title Goes Here</h2>
    $args = array(
        'cat'       => 16, //Replace with category ID of posts to show thumbnail for
        'posts_per_page' =>  6  //Replace with number of posts to show use -1 for all
    $thumbnail_query = new WP_Query( $args ); ?>

            <ul class="sidebar-thumbnails">
    while ( $thumbnail_query->have_posts() ) : $thumbnail_query->the_post();  ?>

                <li><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></li>
            <?php endwhile; ?>

    echo $after_widget;


To modify what posts are used see WP_Query class in the codex.

share|improve this answer
Thanks a lot, I'll try working with that. I actually don't know yet how each thing being linked to will be put up, but I would assume this should work. Thanks. – Torneo Jul 30 '11 at 20:57

Yes, I have one called Pexeto Portfolio Posts Loader. It displays the image from the URL (or whatever image you like) Not sure if it works on every theme because I got it free and it's designed to work with my theme that creates a custom a Portfolio Category. You could look at the code though or email the developer.

It's likely similar to the above. Did the above code work for you?

Not sure how to get it to you...

Updated: I just looked into it further and it looks like Category Posts Widget may work for you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.