document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2.  
  3. /**
  4. * goldrush theme functions and definitions
  5. *
  6. */
  7.  
  8. /**
  9. * Set the content width based on the theme's design and stylesheet.
  10. */
  11. if ( ! isset( $content_width ) )
  12. $content_width = 584;
  13.  
  14. /**
  15. * Tell WordPress to run goldrush_setup() when the 'after_setup_theme' hook is run.
  16. */
  17. add_action( 'after_setup_theme', 'goldrush_setup' );
  18.  
  19. if ( ! function_exists( 'goldrush_setup' ) ):
  20. /**
  21. * Sets up theme defaults and registers support for various WordPress features.
  22. *
  23. * Note that this function is hooked into the after_setup_theme hook, which runs
  24. * before the init hook. The init hook is too late for some features, such as indicating
  25. * support post thumbnails.
  26. *
  27. *
  28. * @uses load_theme_textdomain() For translation/localization support.
  29. * @uses add_editor_style() To style the visual editor.
  30. * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers
  31. * and backgrounds, and post formats.
  32. * @uses register_nav_menus() To add support for navigation menus.
  33. * @uses register_default_headers() To register the default custom header images provided with the theme.
  34. * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  35. *
  36. * @since Twenty Eleven 1.0
  37. */
  38. function goldrush_setup() {
  39.  
  40. /*
  41. * Loads the Optionsframework Panel
  42. */
  43.  
  44. if ( !function_exists( 'optionsframework_init' ) ) {
  45. define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
  46. require_once dirname( __FILE__ ) . '/inc/options-framework.php';
  47. }
  48.  
  49. /* Make goldrush theme available for translation.
  50. * Translations can be added to the /languages/ directory.
  51. * If you're building a theme based on Twenty Eleven, use a find and replace
  52. * to change 'goldrush' to the name of your theme in all the template files.
  53. */
  54. load_theme_textdomain( 'goldrush', get_template_directory() . '/languages' );
  55.  
  56. // This theme styles the visual editor with editor-style.css to match the theme style.
  57. // This function is a callback for custom in-theme TinyMCE editor stylesheets.
  58. //The parameter $stylesheet is the name of the stylesheet, relative to the theme root. It also accepts an array of stylesheets. It is optional and defaults to 'editor-style.css'.
  59. // TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor. TinyMCE has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.
  60. add_editor_style();
  61.  
  62. // Load up our theme options page and related code.
  63. //require( get_template_directory() . '/inc/theme-options.php' );
  64.  
  65. // Grab Twenty Eleven's Ephemera widget which
  66. //displays all of your blog’s Aside, Status, Quote and Link posts in the sidebar.
  67. //require( get_template_directory() . '/inc/widgets.php' );
  68.  
  69. // Add default posts and comments RSS feed links to <head>.
  70. add_theme_support( 'automatic-feed-links' );
  71.  
  72. // This theme uses wp_nav_menu() in one location. 'primary' is the slug name, 'Primary Menu@ is the name to be shown in the admin panel, and 'goldrush' is a namespace
  73. register_nav_menu( 'primary', __( 'Primary Menu', 'goldrush' ) );
  74.  
  75. // Add support for a variety of post formats
  76. add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );
  77.  
  78. // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
  79. add_theme_support( 'post-thumbnails' );
  80.  
  81. }
  82. endif; // goldrush_setup
  83.  
  84. /**
  85. *Adds filter function for custom page templates
  86. *e.g golrush home.php
  87. **/
  88. function goldrush_filter_wp_title( $title, $sep, $sep_location ){
  89.  
  90. if ( is_home() ){
  91.  
  92. //default homepage title
  93. $home_page_title = 'Home';
  94.  
  95. // determine sep_location
  96. if( $sep_location != 'right' ) {
  97. $sep_location = 'left';
  98. // Get the Site Name
  99. $site_name = get_bloginfo( 'name' );
  100. // Prepend name
  101. $filtered_title = $site_name . ' ' . $sep . ' ' . $home_page_title;
  102. // Return the modified title
  103. return $filtered_title;
  104. }
  105. // if sep_location is right
  106. elseif( $sep_location == 'right' ) {
  107. // Get the Site Name
  108. $site_name = get_bloginfo( 'name' );
  109. // Append name
  110. $filtered_title = $home_page_title . ' ' . $sep . ' ' . $site_name;
  111. // Return the modified title
  112. return $filtered_title;
  113. }
  114. }
  115.  
  116. elseif ( !is_home() ) {
  117. // determine sep_location
  118. if( $sep_location != 'right' ) {
  119.  
  120. $sep_location = 'left';
  121. // Get the Site Name
  122. $site_name = get_bloginfo( 'name' );
  123. // Prepend name
  124. $filtered_title = $site_name . $sep . $title;
  125. // Return the modified title
  126. return $filtered_title;
  127. }
  128. // if sep_location is right
  129. elseif( $sep_location == 'right' ) {
  130. // Get the Site Name
  131. $site_name = get_bloginfo( 'name' );
  132. // Append name
  133. $filtered_title = $title . $sep . $site_name;
  134. // Return the modified title
  135. return $filtered_title;
  136. }
  137. }
  138. }
  139. // call our custom goldrush_filter_wp_title filter, with normal (10) priority, and 3 args
  140. add_filter( 'wp_title', 'goldrush_filter_wp_title', 10, 3 );
  141.  
  142. //Enqueue all the scripts that depend on jquery and css
  143. function goldrush_js_enqueue(){
  144.  
  145. wp_enqueue_script( 'jquery.tweet', get_template_directory_uri() . '/js/jquery.tweet.js');//Twitter Feed
  146. wp_enqueue_script( 'flexislider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));//FlexSlider
  147. wp_enqueue_script( 'menujs', get_template_directory_uri() . '/js/menu.js', array('jquery'));//DropDownMenu
  148. wp_enqueue_script( 'flicker', get_template_directory_uri() . '/js/jflickrfeed.min.js', array('jquery'));//Flickr Feed
  149. wp_enqueue_script( 'quicksand', get_template_directory_uri() . '/js/custom.quicksand.js', array('jquery'));//PrettyPhoto
  150. wp_enqueue_script( 'prettyphoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', array('jquery'));//PrettyPhoto
  151. wp_enqueue_style('prettyphoto_css', get_template_directory_uri() .'/css/prettyPhoto.css');
  152.  
  153. }
  154. add_action('wp_enqueue_scripts', 'goldrush_js_enqueue');
  155.  
  156.  
  157. /*Add the Hooks to place the javascript in the header*/
  158. function js_settings_script(){
  159.  
  160. print ("<script>
  161. jQuery(document).ready(function($) {
  162. $('.flexslider').flexslider({
  163. animation: \\"fade\\"
  164. });
  165. $(function() {
  166. $('.show_menu').click(function(){
  167. $('.menu').fadeIn();
  168. $('.show_menu').fadeOut();
  169. $('.hide_menu').fadeIn();
  170. });
  171. $('.hide_menu').click(function(){
  172. $('.menu').fadeOut();
  173. $('.show_menu').fadeIn();
  174. $('.hide_menu').fadeOut();
  175. });
  176. });
  177.  
  178.  
  179. });
  180. jQuery(document).ready(function($) {
  181. $(\\".tweet\\").tweet({
  182. join_text: \\"auto\\",
  183. username: \\"famousthemes\\",
  184. count: 1,
  185. auto_join_text_default: \\"we said,\\",
  186. auto_join_text_ed: \\"we\\",
  187. auto_join_text_ing: \\"we were\\",
  188. auto_join_text_reply: \\"we replied\\",
  189. auto_join_text_url: \\"we were checking out\\",
  190. loading_text: \\"loading tweets...\\"
  191. });
  192. });
  193. </script>");
  194.  
  195. }
  196. add_action('wp_enqueue_scripts', 'js_settings_script');
  197.  
  198. function js_ftsettings_script(){
  199.  
  200. print ("<script type=\\"text/javascript\\">
  201. var main_menu=new main_menu.dd(\\"main_menu\\");
  202. main_menu.init(\\"main_menu\\",\\"menuhover\\");
  203. </script>");
  204.  
  205. }
  206. add_action('wp_footer', 'js_ftsettings_script');
');