コード例 #1
0
<?php

/*
File Name: Wordpress Theme Toolkit
Version: 1.0
Author: Ozh
Author URI: http://planetOzh.com/
*/
include dirname(__FILE__) . '/themetoolkit.php';
themetoolkit('ashfordtheme', array('ashford_separator1' => '&raquo; Customize your site {separator}', 'ashford_theme_style' => 'Choose your color "style" {radio|default|default|white|white <span class="disable">(*enabled with purchase of <a href="http://ashford.turtleinteractive.com/store/pro?utm_source=Ashford%2BCode&utm_medium=Link&utm_content=Select%2BStyle&utm_campaign=Theme%2BOption">Pro</a>)</span>|grey|grey|black|black|purple|purple|blue|blue|lightblue|lightblue|green|green|lime|lime|yellow|yellow|orange|orange|pink|pink|red|red} ##  &raquo; Creates a theme color style.', 'ashford_theme_font' => 'Choose your headline font {radio|default|default|Ubuntu|Ubuntu <span class="disable">(*enabled with purchase of <a href="http://ashford.turtleinteractive.com/store/pro?utm_source=Ashford%2BCode&utm_medium=Link&utm_content=Select%2BStyle&utm_campaign=Theme%2BOption">Pro</a>)</span>|Kreon|Kreon|Orbitron|Orbitron|Arimo|Arimo|Arvo|Arvo|Crimson+Text|Crimson Text|Old+Standard+TT|Old Standard TT|Lekton|Lekton|Anonymous+Pro|Anonymous Pro|Cantarell|Cantarell|Nobile|Nobile|Vollkorn|Vollkorn|Droid+Sans|Droid Sans|Droid+Serif|Droid Serif|Yanone+Kaffeesatz|Yanone Kaffeesatz|Josefin+Sans|Josefin Sans|Tinos|Tinos|Lato|Lato|Puritan|Puritan|Cabin|Cabin|Cousine|Cousine|PT+Serif|PT Serif} ## &raquo; Header and headline typography powered by <a href="http://code.google.com/webfonts" target="_blank">Google Web fonts</a>.', 'page_color' => 'Enter your page color ## &raquo; this MUST be a HEX color (e.g. #FFFFFF or White).', 'display_blog_name' => 'Use custom header {radio|titleoff|Yes|titleon|No} ## &raquo; Choose YES to use the custom header, no to display name and description. Header is used by default.', 'logo_height' => 'Enter custom header height. The default is 100px.', 'text_color' => 'Enter your text color ## &raquo; this MUST be a HEX color (e.g. #555555 or DimGray).', 'ahref_color' => 'Enter your link color ## &raquo; this MUST be a HEX color (e.g. #FF4500 or OrangeRed).', 'ahref_menu_color' => 'Enter your navigation menu link color ## &raquo; this MUST be a HEX color (e.g. #FF4500 or OrangeRed).', 'ahref_hover_color' => 'Enter your link hover color ## &raquo; this MUST be a HEX color (e.g. #F0F8FF or AliceBlue).', 'ahref_footer_color' => 'Enter your footer link color ## &raquo; this MUST be a HEX color (e.g. #FFFFFF or White).', 'ashford_separator2' => '&raquo; Build your site {separator}', 'display_home' => 'Display Home tab {radio|homeon|Yes|homeoff|No} ## &raquo; Choose NO to turn off the home tab.', 'display_search_box' => 'Display Search box {radio|searchon|Yes|searchoff|No} ## &raquo; Choose NO to turn off search box.', 'display_cats_submenu' => 'Display Category Submenu {radio|submenuon|Yes|submenuoff|No} ## &raquo; Choose NO to not display submenu.', 'display_breadcrumbs' => 'Display breadcrumbs {radio|crumbson|Yes|crumbsoff|No} ## &raquo; Choose NO to turn off the breadcrumbs. HTML can be used.', 'sitestripe' => 'Add a site stripe {textarea|3|40} ## &raquo; Use to add a site wide message to every page and post.', 'custom_sidebars' => 'Add custom sidebars {textarea|3|40} ## &raquo; EXPERT USE ONLY. Format as a comma delimited list (e.g. sample,sample_column,sample_page).', 'display_comments_on_pages' => 'Display comments on pages {radio|commentson|Yes|commentsoff|No} ## &raquo; Choose NO to turn off comments on pages.', 'display_footer' => 'Display footer sidebar {radio|footeron|Yes|footeroff|No} ## &raquo; Choose NO to turn off the footer sidebar.', 'speed_dial_ID' => 'Enter your SPEED DIAL category name ## &raquo; Speed Dial buttons appear just above the footer.', 'footer_text' => 'Enter footer text (e.g. Creative Commons) {textarea|3|40} ## &raquo; Leave blank to use default copyright text.', 'display_hints' => 'Display Hints and Widgetized Sidebar Regions {radio|hints|Yes|nohints|No} ## &raquo; Choose NO to turn off the HINTS and Regions.', 'display_blank_state' => 'Display the WELCOME message {radio|welcome|Yes|nowelcome|No} ## &raquo; Choose NO to turn off the the Welcome message on the home page.', 'ashford_separator5' => '&raquo; Navigation Menu {separator}', 'display_drop_down_menu' => 'Select Main Navigation Type{radio|menuon|Drop down pages (default)|menuoff|Static pages|menu|"navigation" Menu (custom menu named "navigation")|mega|Mega menu <span class="disable">(*enabled with purchase of <a href="http://ashford.turtleinteractive.com/store/pro?utm_source=Ashford%2BCode&utm_medium=Link&utm_content=Mega%2BMenu&utm_campaign=Theme%2BOption">Pro</a>)</span>} ## &raquo; <a href="http://ashford.turtleinteractive.com/support/">Please click here for main navigation documentation</a>.', 'ashford_mega_tab1' => 'Enter mega menu tab 1 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-1 sidebar is active.', 'ashford_mega_tab1_num' => 'Enter number of columns for mega menu tab 1 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab2' => 'Enter mega menu tab 2 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-2 sidebar is active.', 'ashford_mega_tab2_num' => 'Enter number of columns for mega menu tab 2 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab3' => 'Enter mega menu tab 3 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-3 sidebar is active.', 'ashford_mega_tab3_num' => 'Enter number of columns for mega menu tab 3 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab4' => 'Enter mega menu tab 4 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-4 sidebar is active.', 'ashford_mega_tab4_num' => 'Enter number of columns for mega menu tab 4 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab5' => 'Enter mega menu tab 5 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-5 sidebar is active.', 'ashford_mega_tab5_num' => 'Enter number of columns for mega menu tab 5 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab6' => 'Enter mega menu tab 6 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-6 sidebar is active.', 'ashford_mega_tab6_num' => 'Enter number of columns for mega menu tab 6 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab7' => 'Enter mega menu tab 7 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-7 sidebar is active.', 'ashford_mega_tab7_num' => 'Enter number of columns for mega menu tab 7 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_mega_tab8' => 'Enter mega menu tab 8 ## &raquo; Required if you selected "Mega Menu" as your main navigation style. Text will be used ONLY if mega_tab-8 sidebar is active.', 'ashford_mega_tab8_num' => 'Enter number of columns for mega menu tab 8 ## &raquo; Enter 1, 2, 3 or 4 columns. Normally equal to the number of widgets.', 'ashford_separator3' => '&raquo; Add followers {separator}', 'facebook_url' => 'Enter Facebook url ## &raquo; Leave blank to NOT use Facebook (e.g. http://facebook.com/timbednar).', 'twitter_url' => 'Enter Twitter url ## &raquo; Leave blank to NOT use Twitter (e.g. http://twitter.com/timbednar).', 'display_rss_subscribe' => 'Display follow Twitter/Facebook/RSS in navigation {radio|rsson|Yes|rssoff|No} ## &raquo; Choose NO to turn off all follow buttons.', 'ashford_separator4' => '&raquo; Grow your site {separator}', 'frontpage_title' => 'Enter front page title ## &raquo; Used on the frontpage. (NOTE: disabled if All in One SEO or Headspace2 plugins are used.)', 'meta_keywords' => 'Enter default meta keywords {textarea|3|40} ## &raquo; Used on the frontpage. (NOTE: disabled if All in One SEO or Headspace2 plugins are used.)', 'meta_description' => 'Enter default meta description {textarea|3|40} ## &raquo; Used on front page (NOTE: disabled if All in One SEO or Headspace2 plugins are used.)', 'feedburner_code' => 'Enter Feedburner url ## &raquo; Leave blank to NOT use Feedburner.', 'rss_text_ad' => 'Append this text to each RSS summary {textarea|2|40} ## &raquo; **NOTE** Works ONLY if you show summaries in your feed.', 'ga_code' => 'Enter Google Analytics Code {textarea|8|40} ## &raquo; Leave blank to NOT use Google Analytics.', 'ashford_separator6' => '&raquo; Ashford Mobile {separator}', 'ashford_use_mobi' => 'Enable Ashford Mobile {radio|mobi_on|Yes <span class="disable">(*enabled with purchase of <a href="http://ashford.turtleinteractive.com/store/pro?utm_source=Ashford%2BCode&utm_medium=Link&utm_content=Mobi&utm_campaign=Theme%2BOption">Pro</a>)</span>|mobi_off|No} ## &raquo; Choose YES to enable Ashford Mobile. Ashford Mobile is on by default.'), __FILE__);
コード例 #2
0
$content_width = 370;
register_sidebar(array('name' => __('Sidebar'), 'id' => 'sidebar', 'before_widget' => '<ul class="nonnavigational">', 'after_widget' => '</ul>', 'before_title' => '<p class="side_title">', 'after_title' => '</p>'));
/*
File Name: WordPress Theme Toolkit Implementation for Theme Minimalissimplistic
Version: 1.0
Author: Ozh
Author URI: http://planetOzh.com/
*/
/************************************************************************************
 * THEME USERS : don't touch anything !! Or don't ask the theme author for support :)
 ************************************************************************************/
include dirname(__FILE__) . '/themetoolkit.php';
/************************************************************************************
 * THEME AUTHOR : edit the following function call :
 ************************************************************************************/
themetoolkit('mytheme', array('floatbar' => 'Sidebar Menu on the {radio|right|Right Hand (default)|left|Left Hand}', 'colortheme' => 'Color theme {radio|red|red (default)|blue|blue|green|green}'), __FILE__);
/************************************************************************************
 * THEME AUTHOR : Congratulations ! The hard work is all done now :)
 *
 * From now on, you can create functions for your theme that will use the array
 * of variables $mytheme->option. For example there will be now a variable
 * $mytheme->option['your_age'] with value as set by theme end-user in the admin menu.
 ************************************************************************************/
/***************************************
 * Additionnal Features and Functions for
 * Theme 'minimalissimplistic'
 *
 * Create your own functions using the array
 * of user defined variables $mytheme->option.
 * An example of function could be :
 *
コード例 #3
0
ファイル: functions.php プロジェクト: psd/hellfettle
<?php

/*
File Name: Wordpress Theme Toolkit
Version: 1.0
Author: Ozh
Author URI: http://planetOzh.com/
*/
/************************************************************************************
 * THEME USERS : Don't touch anything !! Or don't ask the theme author for support (:-0
 ************************************************************************************/
include dirname(__FILE__) . '/themetoolkit.php';
/************************************************************************************
 * FUNCTION ARRAY
 ************************************************************************************/
themetoolkit('mytheme', array('separ1' => 'Typography {separator}', 'showabout' => 'Show "About" Section {checkbox|about|yes|Display the "About" header and the text as entered below} ## If checked, the heading and text below are displayed as a section on the front page. Default is checked.<br/><em><strong>Note to Widgets users:</strong> If you are actively using the Widgets plugin, then this as well as the follow two settings have absolutely no affect.</em>', 'aboutheader' => '"About" Header ## Add/edit the text for the header of the "About" section. If you are showing the "About" section but do not want a header, enter <code>&amp;nbp;</code> for a blank space. Otherwise your page will not validate. Default is About.', 'abouttext' => '"About" Text {textarea|10|55} ## Add/edit text for the content of the "About" section. You can use HTML, but beware of special characters: i.e., &amp; = <code>&amp;amp;</code>. Default is Lorem Ipsum&hellip; .'), __FILE__);
/************************************************************************************
 * FUNCTION CALLS
 ************************************************************************************/
function mytheme_bodyfontsize()
{
    global $mytheme;
    if ($mytheme->option['bodyfontsize']) {
        print 'body { font-size: ';
        print $mytheme->option['bodyfontsize'];
        print "; }\n";
    }
}
function mytheme_bodyfontfamily()
{
    global $mytheme;