Jump to content
xisto Community
Sign in to follow this  
mahesh2k

Wordpress Theme Options

Recommended Posts

I can create my own wordpress themes by converting HTML layouts to wordpress theme using wordpress tags. Now only thing that i have yet to learn or try is creating options page for the themes. By options i mean anything that allows user to control theme from dashboard setting page. Let's say if i want users to add their own analytics code by giving them text area on page and after they hit submit that tracker should get into wordpress footer code where it can execute and track google analytics as it does. So main question here is how to create options page which allows user to add such code to footer or header ?Another point is that if i want to let user handle the color and typography options from the options page. How to do that ? Any idea how to create options page with wordpress ?

Share this post


Link to post
Share on other sites

I researched this now (thanks to you, I had been wondering about the same thing but was too lazy to search), and I found a helpful article on themeshaper.com. Apparently the file you're going to use in your theme folder is called theme-options.php. You call the options file to the index.php by require_once () in functions.php. Then you can get a variable from that file and echo it or run it through loops and conditional statements with php (with this you can echo the analytics code in the appropriate place and find which is the font size choice and echo out the required CSS for that).

 

The article gives you an example zip archive so you can find out how to create the content on the options page yourself (at the bottom): Sample Wordpress Theme Options Page

Share this post


Link to post
Share on other sites

Thanks for the link ban but i already checked that page. I found that tutorial bit complicated as they're relating that with thematic. I would love to see any tutorial which is not framework specific. You and WD have tuts on wordpress, why not add one more on theme options ? :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.