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 8386449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:56:33+00:00 2026-06-09T17:56:33+00:00

Hi I just started today on creating my first WordPress Theme and I am

  • 0

Hi I just started today on creating my first WordPress Theme and I am trying to create a featured Image for each post.Aldo I have managed to acomplish that it seems that the sizes I am giving it are not taking effect.Here is my code:

if(function_exists('add_theme_support')){
   add_theme_support('post-thumbnails' , array('post'));
   set_post_thumbnail_size(200,120);
}

if(function_exists('has_post_thumbnail') && has_post_thumbnail()){
      the_post_thumbnail();
}

It seems that my featured images are not always set to the same size.For example if the image is smaller then what size I set it will remain the same , for big images the width is the same but for some the height is different.

What am I doing wrong here?

  • 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-06-09T17:56:35+00:00Added an answer on June 9, 2026 at 5:56 pm

    Are you setting the thumbnail size in functions.php? It will not work properly if it’s just in index.php or another theme file.

    From the codex:

    This feature must be called before the init hook is fired. That means
    it needs to be placed directly into functions.php or within a function
    attached to the ‘after_setup_theme’ hook. For custom post types, you
    can also add post thumbnails using the register_post_type function as
    well.

    the_post_thumbnail() displays the thumbnail and should be placed where you want the thumbnail to display.

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

Sidebar

Related Questions

I just started C# today, and i have trouble reading an excel file. Here's
So i just started trying to develop a simple webpart today for a sharepoint
I am tryint to read an image with OpenCV 2.1 (started just today), C++
The problem I have just started today, without really changing the code at all.
I've just started creating Unit Tests for my code again. I have had PHPUnit
I just started working with the Flickr API today and I have a question:
I have just started playing with the ASP.Net MVC framework, and today I created
First off sorry if I'm missing something simple just started working with AJAX today.
I just started learning Python today. I have a list: [text:u'Oranges', text:u'Apples', empty:'', empty:'']
I just started thinking about creating/customizing a web crawler today, and know very little

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.