Jump to content

Automatic wordpress post thumbnail


Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/224403-automatic-wordpress-post-thumbnail/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.