Advertisement
STATEDLIGHT

Theme-Settings

Jan 21st, 2013
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. <?php
  2.  
  3. add_action('init','of_options');
  4.  
  5. if (!function_exists('of_options')) {
  6. function of_options(){
  7.  
  8. //Theme Name
  9. $themename ="Tiger";
  10.  
  11.  
  12. //Theme Shortname
  13. $shortname = "tiger";
  14.  
  15.  
  16. //Populate the options array
  17. global $tt_options;
  18. $tt_options = get_option('of_options');
  19.  
  20.  
  21. // Options: number of posts to show on blog page
  22. $blog_number_posts = array("2","4","6","8","10");
  23.  
  24.  
  25. /*-----------------------------------------------------------------------------------*/
  26. /* Create The Custom Site Options Panel
  27. /*-----------------------------------------------------------------------------------*/
  28. $options = array();
  29.  
  30.  
  31. /* Option Page 1 - General Settings */
  32. $options[] = array( "name" => __('General Settings','framework_localize'),
  33. "type" => "heading");
  34.  
  35.  
  36. $options[] = array( "name" => __('Website Logo','framework_localize'),
  37. "desc" => __('Upload a custom logo for your Website.','framework_localize'),
  38. "id" => $shortname."_sitelogo",
  39. "std" => "",
  40. "type" => "upload");
  41.  
  42.  
  43. $options[] = array( "name" => __('Strapline','framework_localize'),
  44. "desc" => __('Use blog description as strapline?','framework_localize'),
  45. "id" => $shortname."_strapline",
  46. "std" => "true",
  47. "type" => "checkbox");
  48.  
  49.  
  50. $options[] = array( "name" => __('Breadcrumbs','framework_localize'),
  51. "desc" => __('Show breadcrumbs?','framework_localize'),
  52. "id" => $shortname."_breadcrumbs",
  53. "std" => "true",
  54. "type" => "checkbox");
  55.  
  56.  
  57. $options[] = array( "name" => __('Post Thumbnails','framework_localize'),
  58. "desc" => __('Enable post thumbnails on blog and home pages?','framework_localize'),
  59. "id" => $shortname."_thumbs_blog",
  60. "std" => "true",
  61. "type" => "checkbox");
  62.  
  63.  
  64. $options[] = array( "name" => __('Latest Posts Slider','framework_localize'),
  65. "desc" => __('Enable latest posts slider on the homepage?','framework_localize'),
  66. "id" => $shortname."_slider",
  67. "std" => "true",
  68. "type" => "checkbox");
  69.  
  70.  
  71. $options[] = array( "name" => __('Number of posts displayed on Blog page','framework_localize'),
  72. "desc" => __('','framework_localize'),
  73. "id" => $shortname."_number_posts",
  74. "std" => "1",
  75. "type" => "select",
  76. "options" => $blog_number_posts);
  77.  
  78.  
  79. $options[] = array( "name" => __('Favicon','framework_localize'),
  80. "desc" => __('Upload a 16px x 16px image that will represent your website\'s favicon.<br /><br /><em>To ensure cross-browser compatibility, we recommend converting the favicon into .ico format before uploading. (<a href="http://www.favicon.cc/">www.favicon.cc</a>)</em>','framework_localize'),
  81. "id" => $shortname."_favicon",
  82. "std" => "",
  83. "type" => "upload");
  84.  
  85.  
  86. $options[] = array( "name" => __('Tracking Code','framework_localize'),
  87. "desc" => __('Paste Google Analytics (or other) tracking code here.','framework_localize'),
  88. "id" => $shortname."_google_analytics",
  89. "std" => "",
  90. "type" => "textarea");
  91.  
  92.  
  93. /* Option Page 2 - Social */
  94. $options[] = array( "name" => __('Social Networks','framework_localize'),
  95. "type" => "heading");
  96.  
  97.  
  98. $options[] = array( "name" => __('Twitter','framework_localize'),
  99. "desc" => "Your Twitter profile URL",
  100. "id" => $shortname."_twitter",
  101. "std" => "",
  102. "type" => "text");
  103.  
  104.  
  105. $options[] = array( "name" => __('Facebook','framework_localize'),
  106. "desc" => "Your Facebook profile/page URL",
  107. "id" => $shortname."_facebook",
  108. "std" => "",
  109. "type" => "text");
  110.  
  111.  
  112. $options[] = array( "name" => __('Linkedin','framework_localize'),
  113. "desc" => "Your Linkedin profile URL",
  114. "id" => $shortname."_linkedin",
  115. "std" => "",
  116. "type" => "text");
  117.  
  118.  
  119. $options[] = array( "name" => __('Youtube','framework_localize'),
  120. "desc" => "Your Youtube channel/profile URL",
  121. "id" => $shortname."_youtube",
  122. "std" => "",
  123. "type" => "text");
  124.  
  125.  
  126. $options[] = array( "name" => __('RSS','framework_localize'),
  127. "desc" => "Your RSS feed URL",
  128. "id" => $shortname."_rss",
  129. "std" => "",
  130. "type" => "text");
  131.  
  132.  
  133.  
  134. update_option('of_template',$options);
  135. update_option('of_themename',$themename);
  136. update_option('of_shortname',$shortname);
  137.  
  138. }
  139. }
  140. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement