Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 712261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:49:43+00:00 2026-05-14T04:49:43+00:00

If you visit this site , you will see that there is an image

  • 0

If you visit this site, you will see that there is an image and summary for each post. What is the proper way to implement that?

Is this done using WordPress custom fields? Or whether this is coded in image.php file present in theme folder? How do I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:49:44+00:00Added an answer on May 14, 2026 at 4:49 am

    There is a better way – you can also use this function too –

    function catch_that_image() {
        global $post, $posts;
            $first_img = '';
            ob_start();
            ob_end_clean();
            $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
            $first_img = preg_replace("/_thumb[0-9]\./", "$1.", $first_img);
    
        // no image found display default image instead
            if(empty($first_img)){
                $first_img = "/wp-content/default.png";
            }
            return $first_img;
    }
    

    if you insert this function to your functions.php of your theme you can insert

    <img src="<?php echo catch_that_image(); >" width="50" height="50" alt="<?php the_title(); ?>" />
    

    in your single.php and index.php

    This function will catch the first image in ever post and will display it, if no one is available – it will use one Default image which you can change…

    Or another way:

    <?php $image = get_post_meta($post->ID, 'postimage', true); ?>
    
    <img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" />
    

    If you put this in your index.php or single.php it will use the image given in field “postimage” (customfield in posts/pages).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Visit this website. https://zapier.com/ See this portion of the website. I wan that same
Please visit this link Click on first Image. Now is showing the Modal page
I'm developing a site where on first visit, the user will be asked to
The other day i just happened to visit this site :- http://www.peter-pearson.com/ Can anybody
I have a RoR site that loads a splash page on the first visit.
Please visit my site . If you look at my slider you will find
I have a chat on a web site that looks like this. I am
Take an example of a question/answer site with a 'browse' slideshow that will show
http://developers.facebook.com/docs/reference/plugins/comments/ It says there that: The mobile version will automatically show up when a
I've visit some popular blogs these days I see that they actually using some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.