southampton_web_designer Posted January 14, 2011 Share Posted January 14, 2011 Hello, I have a website designed in simple php http://www.fsbizcollect.com/. It has a wordpress blog installed under sub-directory called "business-debt-collection-agency-blog" To query posts from blog on home page, I am using: <? foreach($sql->select("wp_posts", "where post_status = 'publish' order by post_date desc limit 3") as $row){ ?> <div class="bEntry"> <h2><?= $row['post_title'] ?></h2> <h3><?= date('F j, Y', strtotime($row['post_date'])) ?></h3> <p> <?= $row['post_excerpt'] ?> <a href="<?= $row['guid'] ?>">Read More</a></p> </div> <? } ?> It is working fine. I want to put post thumbnails on homepage. Post thumbnail should be automatically resized to width=110px and will be placed in : <div class="blogThumb"> POST THUMBNAIL PHP SCRIPT WILL COME HERE </div> Could anyone provide php script for this? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/224403-automatic-wordpress-post-thumbnail/ Share on other sites More sharing options...
QuickOldCar Posted January 14, 2011 Share Posted January 14, 2011 Is a pile of plugins for wordpress, I know there is a few for thumbnails out there. http://wordpress.org/extend/plugins/tags/thumbnails Here's a for instance http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ Quote Link to comment https://forums.phpfreaks.com/topic/224403-automatic-wordpress-post-thumbnail/#findComment-1159265 Share on other sites More sharing options...
southampton_web_designer Posted January 14, 2011 Author Share Posted January 14, 2011 Hi, Thanks for your reply. I can't use plugins because I need to query database from outside of blog directory. Blog is installed in subdirectory. If use any of the functions given in plugin, it is giving php error. I can't even use wordpress functions, in that case also it is giving error. Mmy php code will go in index.php file lying in root directory. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/224403-automatic-wordpress-post-thumbnail/#findComment-1159266 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.