• Resolved matatias

    (@matatias)


    Hey there!

    I’m trying to adapt WordPress to work as a portfolio of drawings which I want to update often. And I need some help!

    In most occasions WordPress show the post title (in the “recent posts” field in the sidebar, or when you choose to see all posts in a category). It would be useful to me to display a thumbnail of the image instead of the post title. But that thumbnail mustn’t be inside the post. I want the reader to choose a drawing category, and then click on a thumbnail to see the big drawing in the post.

    I’ll made the thumbnails myself. I want to write the post, upload the thumbnail and the big drawing and put it into a category.

    Do you know how can I do this? I took a look at some gallery plug-ins, but most of them are written to make “albums”, and I want a semantic structure rather similar to a blog.

    Hope you can help me. Thanks a lot!

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m looking for the exact same thing.

    I could make it work, but just on the index, and I need it on every single page of the site.

    Any ideas?

    See if my plugin will work for you:

    https://guff.szub.net/2006/02/09/post-image/

    This is what I’m doing:

    I creat a second Loop on the Side bar. This works fine on the index.php, showing the images of the last 5 posts. But on any individual post page it just shows me the image for that post. On a Category page, it shows me the images for the last posts of that category.

    Since this works ‘in The Loop’ I’m afraid it might get just to where I am now… being it a problem of the Loop and not of the plugin itself. Unless I’m doing something totally wrong.

    Could I get The Loop to show me the last 5 posts on an individual page?

    Anyway, I guess taking a look won’t hurt.

    THANKS A LOT!

    Here’s a sidebar loop that will display the last 5 posts:

    <?php
    $imgposts = new WP_Query('showposts=5');
    if($imgposts->have_posts()) : while($imgposts->haveposts()) : $imgposts->the_post(); ?>

    ~Your "Loop" template and plugin tags go here~

    <?php endwhile; endif; ?>

    References:

    https://codex.www.ads-software.com/Function_Reference/WP_Query

    https://codex.www.ads-software.com/Template_Tags/query_posts
    (WP_Query() accepts the same parameters as query_posts().)

    Thank you, thank you, thank you!

    hi all, i’m attempting to do roughly the same thing as Tienchita is, i’d like to see the last few posts displayed by icons.

    i’ve got it partially working. the post is displayed, and a small thumbnail is displayed below the picture, that’s all great, however i want to see all previous 5 posts icons.

    i’m doing this in the main index page instead of the sidebar like meantioned above. here is the code i’ve inserted into the main index:

    
    <! -- BEGIN recent posts-->
    <?php
    $imgposts = new WP_Query('showposts=5');
    if($imgposts->have_posts()) : while($imgposts->haveposts()) : $imgposts->the_post(); ?>
    
    <?php post_image('/blog/wp-content/images/post.jpg', true); ?>
    
    <?php endwhile; endif; ?>
    <!-- END recent -->
    

    i get the following error at the bottom of my index:

    Fatal error: Call to undefined method WP_Query::haveposts() in /var/www/tehchad.com/htdocs/wp-content/themes/nishita/index.php on line 30

    any help would be much appreciated! -chad.

    Am also trying to implement this feature into a sidebar for https://www.digitalencore.co.uk.

    as i want an image to show and then a except in the column for my review section.

    am currently using this code in my sidebar after installing post image

    <div id=”side_two” class=”side”>

    <h3>Reviews</h3>

      <?php if (have_posts()) : ?>
      <?php while (have_posts()) : the_post(); ?>

      <!– Begin Post Container –>
      <div class=”post” id=”post-<?php the_ID(); ?>”>
      <div class=”entry”>

      <!– Begin Thumb Container –>
      <div class=”postthumb”>“><?php post_image(”, true, true); ?>
      </div>
      <!– End Thumb Container –>
      <div class=”posttext”>
      <h3>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h3>
      <?php the_excerpt(); ?>
      </div>
      <div class=”clear”></div>
      </div>
      </div>
      <!– End Post Container –>
      <?php endwhile; ?>
      <?php else : ?>
      <h3 class=”center”>Not Found</h3>
      <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
      <?php endif; ?>

    <h3>Topics</h3>

      <?php wp_list_cats(‘sort_column=name&optioncount=0’); ?>

    <h3>Archives</h3>

      <?php wp_get_archives(‘type=monthly’); ?>

    <!– Uncomment this if you have more than one author

    <h3>Authors</h3>

      <?php wp_list_authors(‘show_fullname=1&exclude_admin=0’); ?>

    –>

    </div>
    <div class=”clear”></div>

    now how do i activate it when writing the post – so that the image comes up in the sidebar?, will this code work to do that? – i would like this feature to be for the top 5 last category enteries as well – any idea on how to do this. (is there a beginners guide on how to use this plugin/loop function?)

    many thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Images instead of post titles in “Recent posts”’ is closed to new replies.