Jump to content

Automatic wordpress post thumbnail


 Share

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
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

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.