Automatically generate thumbs from frontend in FolioGridPro 1.0.5 - Wordpress Solution
[Solved] - Automatically generate thumbs from frontend in FolioGridPro 1.0.5 - Wordpress Solution
Try following codes
i am setting a little social network with wp and bp. Here is the demo (with fonny content and users) http://lalulula.com/red/ i want both registerd authors and non registered to be able to post an image from the frotend, so i installed a "Gravity Forms" form in the sidebar to do so. i also installed "Auto Post Thumbnail" plugin so that the post will display the thumb on the index page. And here comes the problem: the form works great and the featured image is automatically generated (it appears in the backend settings of the post), but the thumb doesnt appear in the index. (the ones that appear rigth now i had to set them from the backend) i am using FolioGrid Pro 1.0.5 theme, and it has a special feature regarding the thumbs display when editing post from the backend. i am assuming this is what forbids the thumb to be automatically displayed i the index. i have tryed with diferet frontend posting and diferent automatically generate thumbs methods, but the problem remains. i am hopping some of you can figure out a way to achieve this. i am using WordPress 3.4.2 and Buddypress 1.6.1 if it helps.

Solution - 1

You can add post thumbnail to index page by just adding 1 simple code line .

the_post_thumbnail( array(100,100) );
uninstall auto post thumbnail and add this code to your themes index.php just after
 the_title(  );
100, 100 in the_post_thumbnail( array(100,100) ); is for the size of thumbnail . adjust size as per your need. i hope this will work for you .

Solution - 2

Un install the Auto Post Thumbnail Plugin and add this lines somewhere in your "functions.php"

add_image_size('custom_thumb', 200, 200, true);

function excerpt_thumbnail($excerpt)
        if(is_single()) return $excerpt;
        global $post;
        if ( has_post_thumbnail() ) 
        $img .= '<a href=" '.get_permalink($post->ID).' ">'.get_the_post_thumbnail($post->ID, 'custom_thumb').'</a>';
        } else {
        $img = 'http://website.com/link-of-a-dummy-image.jpg';
    return $img.$excerpt;

Then Go to your stylesheet to play around with the style: The class of your featured image thumbnail will be .attachment-custom_thumb so if you want to style it you can just add these lines to your style.css file (your theme style-sheet):

.attachment-custom_thumb { float: left; margin: 2px; }
No need to edit your index or other template pages. Let me know if this works with you.

Solution - 3

can you share the function which shows posts to front end , also show how it shows thumbnails

Date: 2022-10-21 05:03:58
Category: Wordpress
More for You