Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Three Questions with Twenty Eleven theme

Adding a post thumbnail is pretty easy, open content.php, if you’re using excerpts on your homepage find this

<?php the_excerpt(); ?>

then add this just above that line

<?php the_post_thumbnail('thumbnail', 'class=alignleft'); ?>

If you’re not using excerpts add it above

<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>

If you’d like a specific image size for your post thumbnails you can add something like this to functions.php, change 140, 140 to whatever size you want.

add_image_size('excerpt-thumbnail', 140, 140, true);

Then change

<?php the_post_thumbnail('thumbnail', 'class=alignleft'); ?>

To

<?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?>

Then just add a featured image to a post. It’s best to do this with by creating a child theme.

Not sure what you’re asking for the first two questions, maybe you could explain them a little more.

Related Posts:

  1. How do I change/modify the_post_thumbnail(); html output?
  2. What’s the best way to use the Featured Image for responsive web design?
  3. Adding Featured Image to Post programatically
  4. How to upload imagick resource to media in wordpress
  5. How do I get images (with a thumbnail preview) to show in search results?
  6. Assign a picture URL to a page via PHP
  7. How to scale image with equal width and height without distortion?
  8. Echo URL of large version of Featured Image
  9. Recent posts with featured image or fallback image with permalink
  10. Set the background to a default image if there isn’t a specified “featured image”
  11. Enable custom logo upload if logo is not in header
  12. Resize image to specific dimension (X to Y ratio)
  13. Get featured image with custom size outside WordPress
  14. Else/If Statement to Display Photo Descriptions
  15. How to set a featured image (thumbnail) with PHP?
  16. Generate responsive post thumbnails of same size
  17. How to Make Thumbnail of Post Stay Animated
  18. not outputting medium size image URL
  19. Replace background image with post thumbnail in shortcode
  20. Resize post thumbnail
  21. add class to background image
  22. Changing 2011 theme header image based on user dropdown
  23. Setting post thumbnail sizes in template file and functions.php
  24. add if statement to the featured image
  25. Remove default Image Sizes
  26. Generate and upload screenshot as featured image for user-submitted post
  27. Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
  28. How to get next image with this code from same post?
  29. Unread Repeater field IMG alt not working
  30. Can’t upload image using media_sideload_image
  31. Upload multiple images to a Woocomerce product
  32. How to use thumbnail size of image if I’m only using src to get image
  33. Display custom post type title as text if post thumbnail is not available
  34. What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
  35. Accessing an image folder inside public web directory
  36. get_children displaying images removed from the page
  37. Why is image hard cropping for one image using add_image_size not working?
  38. Why my image upload button is not working in wordpress widget area?
  39. Scrape external webpage for first image and add it to new post
  40. How to make own crop image function for WordPress plugin
  41. “imagejpeg” function is not working in wordpress
  42. Display image from an external rss feed on wordpress without plugins
  43. Redirect to another page using contact form 7? [closed]
  44. WordPress automatically adds links to uploaded images
  45. post thumbnail, conditions, else wont work
  46. WordPress function when file is uploaded, deleted or edited
  47. ‘Post-thumbnails’ feature does not seem to register
  48. height should be set to auto to avoid pixelation in the post thumbnail function
  49. Download images from media library to computer in BULK?
  50. Display related posts without a plugin
  51. How to set the WordPress logo programmatically with PHP
  52. How to loop through all the attached images in a post, and get their url one by one
  53. Which function crops images in wordpress?
  54. WordPress function and string as variable?
  55. Division by zero error in image.php
  56. How can I automatically resize up images to fit into all of my registered image sizes
  57. Do I have anything to worry about when switching to a default theme to test for plugin conflictions?
  58. Clickable image link sends people to wrong URL
  59. Apply class to every third list item? [duplicate]
  60. Only show image from custom field when present
  61. Timthumb.php image gallery not working on Multisite WordPress
  62. Upload non-featured image to image field
  63. Automatically add images to a menu
  64. Where are the src and srcset sizes coming from?
  65. HTML showing after PHP code in tag
  66. Only show first image in foreach loop
  67. trying to get wp_get_attachment_url to output clickable link
  68. Using featured image of blog archive page
  69. Change default gallery images – Currently they are displaying full size imagese
  70. if custom field doesn’t exist, use post thumbnail instead, as image background
  71. I’m unable to call img path using single quotes in an array?
  72. Creating black and white copy of an image [closed]
  73. How to change logo by category
  74. Help Fallback (thumbnail)
  75. get_header_image() causes “Prioritize visible content” issue in Page Speed Insights
  76. Get the id of all images in a post
  77. Shortcode function doesnt work without caption
  78. How to add post thumbnail dynamically using Jquery?
  79. Images Uploaded saving onto older/previous year folders
  80. Display an image based on field value
  81. Add valid XHTML closing img tags to WordPress galleries
  82. Convert canvas to image and upload image to server
  83. How to change thumbnail src attribute?
  84. Error display post thumbnails for previous and next post
  85. Controlling image output size ACF repeater [closed]
  86. Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
  87. WordPress İmages Upload & Delete Error
  88. Get the featured image url of clicked post
  89. Fallback image URL if no featured image exists via a shortcode function
  90. How to replace URL protocol using PHP?
  91. Call featured image url
  92. How to pick “full/thumbnail” images in the loop?
  93. WordPress Twenty Eleven PhP – forcing php code to skip first post on homepage?
  94. Get the alt text of the image in a array
  95. Display post thumbnail in foreach loop
  96. Attaching images to posts manually (i.e. with custom code, without the use of an API)
  97. Adding a ‘style=’ bit to image_send_to_editor output
  98. Convert all uploaded PNG files to PNG-8 format
  99. foreach repeat html structure after every nth for attachment [closed]
  100. Trying to change featured image from 180×180 to full width on home page
Categories PHP Tags images, logo, php, post-thumbnails, theme-twenty-eleven
WordPress wp_redirect error
placeholder text in category form label

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress