WordPress.org

Support

Support » Plugins and Hacks » New plugin: Post Thumbs

New plugin: Post Thumbs

  • Hi everyone,

    I made a new plugin called Post Thumbs to share. It has barely been tested, so if anyone tries it and has some problems hopefully I’ll know what’s wrong. It works on my site fine.

    What it does is scan a post for an included image and convert that image into a thumbnail to be used in The Loop. You could use this to show a list of posts as thumbnail links if you wanted. It will only work for images that reside on your server. No support for cross domain images as of yet.

    The documentation is shoddy, but it’ll have to do for now. If anyone has any suggestions, feel free to reply. The plugin is here.

Viewing 15 replies - 1 through 15 (of 84 total)
  • Nice work, sunscream. I think a lot of people are going to like this plugin — I know I like it! I’ve been waiting for something like this for a long time!

    Your site looks pretty decent as well 🙂

    i have this error:

    Warning: getimagesize(/home/.dodge/user/domain.com/images/image.jpg): failed to open stream: No such file or directory in /home/.dodge/user/domain.com/wp-content/plugins/post-thumb/post-thumb.php

    This looks great! However, is it possible to limit it to only one category? For example, I only want to show the most recent 8 posts from cat=3. Is this possible?

    for me don’t work, the plugin doesn’t create any thumb…i don’t know which is the problem

    Nope, I can’t seem to get this working… do you have clearer details on what to include in the loop? Sorry, I know I am slow sometimes…. 😉

    @Macromail

    I think that problem may be related to the base path you have to set. I would suggest making a small file called test.php and upload it to your root folder on your server. In test.php, write

    <?php echo $_SERVER['DOCUMENT_ROOT']; ?>

    Navigate to that file in a browser and it will echo the base path you should use (hopefully). Did you set the base path to “/home/.dodge/user/domain.com”?

    @wordpresschina

    I’m not sure which part you are having problems on, but this is what I have put in for my sidebar.

    <?php
    $posts = get_posts('numberposts=6&offset=9&order=DESC');
    foreach($posts as $post) :
    setup_postdata($post);
    $post_link = tb_post_thumb(true,$post->post_title);
    if ( !empty($post_link) ) {
    echo $post_link; }
    endforeach;
    ?>

    Ah, ok, great, yes using your code works–almost. I have the pics appearing now just fine. However, there are no links on them to their respective posts… also, is there a way for me to line them up one on top of each other, instead of in a row?

    Tks!

    For linking, instead of just echo $post_link, you could do this.

    if ( !empty($post_link) ) {
    ?><a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" class="highlight"><?php echo $post_link; ?></a><?php }
    endforeach;

    You could use an unordered list for putting them on top of each other and use css to format it however you want.

    Perfect! Works fine now. 🙂

    This is an awesome plugin!

    For anyone using this, it has been updated. You can now specify a regular expression to check if a post has a video file (actually I guess anything) and use a different default image for that. Just make sure you use the right regex like for wp-extreme video it will need to find [gv data=… Also, fixed some coding issues for crop / resize and added an option to crop an image after resizing. Remember to escape your regex on double quotes.

    I access my website at http://steve.asmallorange.com/~username , and because of the tilde, I get the following error:

    Warning: preg_match() [function.preg-match]: Unknown modifier '~' in /home/username/public_html/wp-content/plugins/post-thumb.php on line 45

    I replaced it with %7e, but that gave me the same error for the %. Am I doing something wrong? Help appreciated, this plugin would be perfect for what I need.

    I have uploaded a fixed version. Please tell me if you still get the same error.

    Nope, I’m getting the same error. I noticed that all my settings were saved, even though I deactivated, reloaded correct plugin files, and activated.

    Is there something else I need to do to remove the plugin, maybe?

    Oops, sorry. Please, download again. The fix seemed to have not uploaded correctly. Right click, save as just in case it’s still cached. Settings should still be saved.

    Good news: Errors are gone! 😀

    Bad news: Image still hasn’t appeared. Since there’s no error, I’m assuming it’s detecting the file and all the paths are correct, right?

    EDIT: It’s not a permissions error. I tried echoing the value of the tag instead of displaying it automatically, and it displayed the link. I might use that as a workaround, but that’s where the problem is, FYI.

    By the way, thanks a lot so far. It’s really a nice plugin, and I’ll definitely link back to you once the site’s finished. 🙂

    And here’s my HTML/PHP:

    <div class="post-image"><?php tb_post_thumb(true); ?></div>

    Final question: Does the plugin work if my index uses the_excerpt() and not the_content()? If so, does it check the excerpt for images, or only the content?

Viewing 15 replies - 1 through 15 (of 84 total)
  • The topic ‘New plugin: Post Thumbs’ is closed to new replies.