WordPress Image Post Options

One of the greatest thing I have learned with WordPress is how to create a custom post or page box. One of my favorite thing to do when creating a WordPress theme is to create a Image Post Option. This can come in real useful if you have a theme that need a image to be the same size every time. For instance on my site you will see that in everyone of my posts there is a image that is the same size. This gives your site a feel or consistency. In order to build this custom option for your site you have to understand a few things. If you are someone that would just like to have this on there site but have no clue about code stop right now. In order to get this to work you have to edit your theme and create styles that control the images. If you are looking to build a theme and would like to add this to your theme you are the kind of person that should continue.

Step One – Adding Code To Your Functions.php File

I am going to try and make this quite simple so that you really don’t have to understand what it does you just have to understand where it goes. Inside your WordPress Theme file you should add the code below to your functions.php file. Make sure that the code is inside of your < ?php ?> code.

Step Two – Adding The Image To Your Theme

This is where the fun part comes in to play. With this part you need to decide if you are going to have the image pulled in with a auto size and maybe a resizing function like timthumb. Timthumb is a great function because it resizes your image and crunches it down to a more web useful size. For instance most people don’t know that image are most of the time to big to have on a website. You must re-save a image so that it is web quality. What that means is so that it isn’t so big that it makes your website slow. I will be showing you how to do this with the timthumb function.

This code can be recreated to your needs. In order to set the size of your image you will see w=283 and h=120 that is your height and width. Now if you were to not want to use the Timthumb function all you would need inside the image field is src=”< ?=$values[0];?> alt=”< ?the_title(); ?>“. With that finished let go to the next step to get Timthumb working correctly.

Step Three – Finishing Timthumb

In order to finish Timthumb you need to setup your folders inside of your theme you will need to create a folder called scripts. Inside of there you will need to create a folder called cache. You will also have to download the Timthumb file here [Download not found]. Add this file to your scripts folder. You will need to make sure that your folder permissions are 755. After you have finished this you will be done. Again the code to get the image can be placed where ever you would like it.

Website Design , Development, and SEO Marketing

If by chance you are in need of any web design, web development, search engine optimization, or marketing done to one of your sites you can get in contact with me or you can contact Chosen. Chosen is a Lansing based Web Development, Web Design, Web Hosting, and Web Marketing firm. We are a small business but are growing in the Lansing Area for our Web Design and Development skills. We have done work for clients and companies. We prefer client work but we also take contract work. We have worked with most of the biggest web companies in the Lansing Area and all the way out to California. We would love to hear from you.

About Shane

Hi I am Shane the main author of this blog. I am a self taught web developer. I have been working in this industry since 2008. I work a lot with WordPress, Magento, SEO & SEM, and custom built websites. I love all sports and I will try anything at least twice.

Working remotely is one of the fastest growing perks in the working world. It’s something that people talk about a lot, and it’s a solution to the “work/life balance” problem that bothers so many people. Most of us have asked the question, “Why do I work so hard?” For some people, there are many sides

Know little about the use of keylogger for Android? Wondering why so many friends choose free Android spy? What benefits can you get from tracking cell phones of your children and employees with the help of sms tracker? Keep reading and find the answers in this short article. Have you ever dreamed of taking control

As a photographer whether it be a hobby or on a professional level the realm of high dynamic range photography can be very troublesome without photo editing software specifically made for photo HDR. Aurora HDR photography can be very challenging as it is, but with Aurora the job gets a little bit easier. Some might

  • mbt sale

    Splendid, collection