Plugin Directory

Fitr Theme Options

It makes template customizing easy and bring more fun to WordPress!

I'm a Theme designer how can I add your plugin support to my theme?

Simply! Just copy and paste this code in your functions.php. Replace Kubrick CSS elements with your theme elements.

if ( function_exists('register_fitr_theme_options') ) { register_fitr_theme_options(array( 'blogtitle'=>'#headerimg h1', 'blogdescription'=>'#headerimg .description', 'header_background'=>'#headerimg', //Maybe for background color, background image or logo. It's require to enter width and height for image and logo. 'headerimg_path'=>'images/kubrickheader.jpg', //Default header image e.g. 'images/header.jpg' 'headerimg_width'=>'760', //pixel 'headerimg_height'=>'200', 'container'=>'#page', //Main blog div e.g. .wrap .maincol or #page 'feedicon'=>'', 'menubar'=>'', //Menu container e.g. #menu or #nav 'menuli_bg'=>'', //e.g. #nav ul li span 'menuli_bghover'=>'', //Separate with comma(,) e.g. #nav li:hover, .current_page 'menuli_a'=>'', //Add a 'postbox'=>'.post', //Post container includes title, content, etc 'posttitle'=>'.post h2,.post h3', 'postcontent'=>'.entry', 'postmeta'=>'.narrowcolumn .postmetadata', 'date'=>'.post small', 'author'=>'', 'trackback'=>'', 'allowed_html'=>'', 'widgettitle'=>'#sidebar ul li h2', 'sidebarbody'=>'#sidebar', 'widgetbox'=>'#sidebar ul li', 'widgetli_a'=>'#sidebar ul li ul li a', //Add a 'footer'=>'#footer' ) ); }

If you want that users without Fitr Theme Options can use your option page you should copy FTO directory to your theme directory and add this line to functions.php

include('fitr-theme-options/fitr-theme-options.php');

All done!

Continue reading to add more features to your theme.

How can I define different styles for my theme?

You can define different styles with register_fitr_theme_style( $name, $path, $screenshot ). For example:

if (function_exists(register_fitr_theme_style)) { register_fitr_theme_style('Red','red.css','red-screenshot.png'); register_fitr_theme_style('Green','styles/green.css','green-screenshot.jpg'); }

The chosen style will be saved in fto_settings option (fto_impot_style key). For example:

$settings=get_option('fto_settings'); if ('styles/green.css' == $settings['fto_import_style']) echo "You love green!";

How can I add more option field to FTO page?

There is another great feature in Fitr Theme Option. You can add custom fields to option page using fto_add_custom_field( $name, $type, $desc, $options='' ). $type can be: text, checkbox, number, color, textarea, dropdown, cat or page. $options is necessary for 'dropdown' and 'radio' types. Separate options with '|'. As above the value will be saved in fto_setteings option. For example:

fto_add_custom_field('welcome_text', 'text', 'Type some thing as welcome message'); fto_add_custom_field('layout','dropdown','Choose your blog layout','One Column|Two Columns');

You can get selected style with fto_settings option.

$settings=get_option('fto_settings'); if ('Two Columns' == $settings['layout']) //layout is field name include('sidebar.php');

What more?

After adding codes you should test your theme. If your theme does not appear correctly for a certain item (for example blog title align) You can easily fix the problem via CSS and PHP (Use fto_settings option).

Requires: 2.7 or higher
Compatible up to: 2.9.2
Last Updated: 2009-11-15
Downloads: 7,599

Average Rating

4 stars
(8 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,1,1
100,1,1
0,1,0