tinfishworld

Functions.php - tinfishworld

Aug 1st, 2013
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.93 KB | None | 0 0
  1. <?php
  2. /**
  3.  * progression functions and definitions
  4.  *
  5.  * @package progression
  6.  * @since progression 1.0
  7.  */
  8.  
  9.  
  10. // Post Thumbnails
  11. add_theme_support('post-thumbnails');
  12. add_image_size('progression-slider-retina', 2000, 925, true);
  13. add_image_size('progression-slider', 1500, 694, true);
  14. add_image_size('progression-page-title', 1600, 300, true);
  15. add_image_size('progression-blog', 1140, 435, true);
  16. add_image_size('progression-portfolio-thumb', 600, 338, true); //600 wide by 1200 tall Image cropped
  17. add_image_size('progression-single-portfolio', 1140, 550, true);
  18. add_image_size('progression-single-portfolio-uncropped', 1140, 1000, false);
  19. add_image_size('progression-menu-tall', 300, 375, true);
  20.  
  21.  
  22. /**
  23.  * Set the content width based on the theme's design and stylesheet.
  24.  *
  25.  * @since progression 1.0
  26.  */
  27. if ( ! isset( $content_width ) )
  28.     $content_width = 640; /* pixels */
  29.  
  30.  
  31. /*
  32.  * Loads the Options Panel
  33.  *
  34.  * If you're loading from a child theme use stylesheet_directory
  35.  * instead of template_directory
  36.  */
  37. if ( !function_exists( 'optionsframework_init' ) ) {
  38.     define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
  39.     require_once dirname( __FILE__ ) . '/inc/options-framework.php';
  40. }
  41.  
  42. //Added to work around the issue with Events Calendar Pro returning 404 titles.
  43.  if( function_exists('avoid_404_event_titles')){
  44.          function avoid_404_event_titles() {
  45.         global $wp_query;
  46.  
  47.         if (property_exists($wp_query, 'tribe_is_event') && $wp_query->tribe_is_event && $wp_query->is_404)
  48.                 $wp_query->is_404 = false;
  49. }
  50.  
  51.          add_action('template_include', 'avoid_404_event_titles', 1);
  52.  };
  53.  
  54. if ( ! function_exists( 'progression_setup' ) ):
  55. /**
  56.  * Sets up theme defaults and registers support for various WordPress features.
  57.  *
  58.  * Note that this function is hooked into the after_setup_theme hook, which runs
  59.  * before the init hook. The init hook is too late for some features, such as indicating
  60.  * support post thumbnails.
  61.  *
  62.  * @since progression 1.0
  63.  */
  64. function progression_setup() {
  65.    
  66.    
  67.     // This theme styles the visual editor with editor-style.css to match the theme style.
  68.     add_editor_style();
  69.  
  70.     /**
  71.      * Custom template tags for this theme.  Blog Comments Found Here
  72.      */
  73.     require( get_template_directory() . '/inc/template-tags.php' );
  74.  
  75.  
  76.     /**
  77.      * Registering Custom Meta Boxes
  78.      * https://github.com/tammyhart/Reusable-Custom-WordPress-Meta-Boxes
  79.      * Include the file that creates the class and a file that instantiates the class
  80.      */
  81.     require( get_template_directory() . '/metaboxes/meta_box.php' );
  82.     require( get_template_directory() . '/inc/custom_meta_boxes.php' );
  83.    
  84.    
  85.     // Include widgets
  86.     require( get_template_directory() . '/widgets/widgets.php' );
  87.    
  88.     // Shortcodes
  89.     include_once('shortcodes.php');
  90.    
  91.  
  92.     /**
  93.      * Make theme available for translation
  94.      * Translations can be filed in the /languages/ directory
  95.      * If you're building a theme based on progression, use a find and replace
  96.      * to change 'progression' to the name of your theme in all the template files
  97.      */
  98.     load_theme_textdomain( 'progression', get_template_directory() . '/languages' );
  99.  
  100.     /**
  101.      * Add default posts and comments RSS feed links to head
  102.      */
  103.     add_theme_support( 'automatic-feed-links' );
  104.  
  105.  
  106.  
  107.     /**
  108.      * This theme uses wp_nav_menu() in one location.
  109.      */
  110.     register_nav_menus( array(
  111.         'primary' => __( 'Primary Menu', 'progression' ),
  112.         'footer' => __( 'Footer Menu', 'progression' ),
  113.     ) );
  114.    
  115.  
  116.  
  117. }
  118. endif; // progression_setup
  119. add_action( 'after_setup_theme', 'progression_setup' );
  120.  
  121.  
  122.  
  123. if( class_exists( 'kdMultipleFeaturedImages' ) ) {
  124.  
  125.     $args1 = array(
  126.                 'id' => 'featured-image-2',
  127.                 'post_type' => 'page',      // Set this to post or page
  128.                 'labels' => array(
  129.                     'name'      => 'Featured image 2',
  130.                     'set'       => 'Set featured image 2',
  131.                     'remove'    => 'Remove featured image 2',
  132.                     'use'       => 'Use as featured image 2',
  133.                 )
  134.         );
  135.  
  136.         $args2 = array(
  137.                 'id' => 'featured-image-3',
  138.                 'post_type' => 'page',      // Set this to post or page
  139.                 'labels' => array(
  140.                     'name'      => 'Featured image 3',
  141.                     'set'       => 'Set featured image 3',
  142.                     'remove'    => 'Remove featured image 3',
  143.                     'use'       => 'Use as featured image 3',
  144.                 )
  145.         );
  146.    
  147.  
  148.         new kdMultipleFeaturedImages( $args1 );
  149.         new kdMultipleFeaturedImages( $args2 );
  150. }
  151.  
  152.  
  153.  
  154. /**
  155.  * Registering Portfolio Custom Post Type
  156.  */
  157. add_action('init', 'pyre_init');
  158. function pyre_init() {
  159.     register_post_type(
  160.         'portfolio',
  161.         array(
  162.             'labels' => array(
  163.                 'name' => 'Portfolio',
  164.                 'singular_name' => 'Portfolio'
  165.             ),
  166.             'public' => true,
  167.             'has_archive' => true,
  168.             'rewrite' => array('slug' => 'portfolio-type'),
  169.             'supports' => array('title', 'editor', 'excerpt', 'thumbnail','comments'),
  170.             'can_export' => true,
  171.         )
  172.     );
  173.    
  174.     register_post_type(
  175.         'menu',
  176.         array(
  177.             'labels' => array(
  178.                 'name' => 'Menu',
  179.                 'singular_name' => 'Menu Item'
  180.             ),
  181.             'public' => true,
  182.             'has_archive' => true,
  183.             'rewrite' => array('slug' => 'menu-type'),
  184.             'supports' => array('title', 'editor', 'excerpt', 'thumbnail','comments'),
  185.             'can_export' => true,
  186.         )
  187.     );
  188.  
  189.     register_taxonomy('portfolio_type', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Categories', 'query_var' => true, 'rewrite' => true));
  190.    
  191.     register_taxonomy('menu_type', 'menu', array('hierarchical' => true, 'label' => 'Menu Categories', 'query_var' => true, 'rewrite' => true));
  192.    
  193. }
  194.  
  195.  
  196.  
  197.  
  198.  
  199. /**
  200.  * Register widgetized area and update sidebar with default widgets
  201.  *
  202.  * @since progression 1.0
  203.  */
  204. function progression_widgets_init() {
  205.     register_sidebar( array(
  206.         'name' => __( 'Sidebar', 'progression' ),
  207.         'id' => 'sidebar-1',
  208.         'before_widget' => '<div id="%1$s" class="widget %2$s">',
  209.         'after_widget' => '</div><div class="sidebar-spacer"></div>',
  210.         'before_title' => '<h3 class="widget-title">',
  211.         'after_title' => '</h3>',
  212.     ) );
  213.    
  214.     register_sidebar( array(
  215.         'name' => __( 'Footer Widgets', 'progression' ),
  216.         'id' => 'footer-widgets',
  217.         'before_widget' => '<div id="%1$s" class="widget homepage-widget %2$s">',
  218.         'after_widget' => '</div>',
  219.         'before_title' => '<h3 class="header-underline">',
  220.         'after_title' => '</h3>',
  221.     ) );
  222.    
  223.     register_sidebar( array(
  224.         'name' => __( 'Menu Widgets Column 1', 'progression' ),
  225.         'id' => 'menu-widgets-col-1',
  226.         'before_widget' => '<div id="%1$s" class="widget menu-widget %2$s">',
  227.         'after_widget' => '</div><div class="menu-spacer"></div>',
  228.         'before_title' => '<h3 class="header-underline">',
  229.         'after_title' => '</h3>',
  230.     ) );
  231.    
  232.     register_sidebar( array(
  233.         'name' => __( 'Menu Widgets Column 2', 'progression' ),
  234.         'id' => 'menu-widgets-col-2',
  235.         'before_widget' => '<div id="%1$s" class="widget menu-widget %2$s">',
  236.         'after_widget' => '</div><div class="menu-spacer"></div>',
  237.         'before_title' => '<h3 class="header-underline">',
  238.         'after_title' => '</h3>',
  239.     ) );
  240.    
  241. }
  242. add_action( 'widgets_init', 'progression_widgets_init' );
  243.  
  244.  
  245.  
  246.  
  247. // Pagination
  248. function kriesi_pagination($pages = '', $range = 2)
  249. {  
  250.      $showitems = ($range * 2)+1;  
  251.  
  252.      global $paged;
  253.      if(empty($paged)) $paged = 1;
  254.  
  255.      if($pages == '')
  256.      {
  257.          global $wp_query;
  258.          $pages = $wp_query->max_num_pages;
  259.          if(!$pages)
  260.          {
  261.              $pages = 1;
  262.          }
  263.      }  
  264.  
  265.      if(1 != $pages)
  266.      {
  267.          echo "<div class='pagination'>";
  268.          if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'><span class='arrows'>&laquo;</span></a>";
  269.          if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'><span class='arrows'>&lsaquo;</span></a>";
  270.  
  271.          for ($i=1; $i <= $pages; $i++)
  272.          {
  273.              if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
  274.              {
  275.                  echo ($paged == $i)? "<a href='#' class='selected'>".$i."</a>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>";
  276.              }
  277.          }
  278.  
  279.          if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'><span class='arrows'>&rsaquo;</span></a>";  
  280.          if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'><span class='arrows'>&raquo;</span></a>";
  281.          echo "</div>\n";
  282.      }
  283. }
  284.  
  285.  
  286.  
  287.  
  288.  
  289. // Pagination
  290. function infinite_kriesi_pagination($pages = '', $range = 1)
  291. {  
  292.      $showitems = ($range);  
  293.  
  294.      global $paged;
  295.      if(empty($paged)) $paged = 1;
  296.  
  297.      if($pages == '')
  298.      {
  299.          global $wp_query;
  300.          $pages = $wp_query->max_num_pages;
  301.          if(!$pages)
  302.          {
  303.              $pages = 1;
  304.          }
  305.  
  306.      }  
  307.  
  308.      if(1 != $pages)
  309.      {
  310.          echo "";
  311.          if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "";
  312.  
  313.          if($paged > 1 && $showitems < $pages) echo "";
  314.  
  315.  
  316.          for ($i=1; $i <= $pages; $i++)
  317.          {
  318.    
  319.              if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range+1) || $pages <= $showitems ))
  320.              {
  321.                  echo ($paged == $i)? "":"<nav id='page-nav'><a href='".get_pagenum_link($i)."'>".__('Load More', 'progression')."</a></nav>";
  322.              }
  323.            
  324.          }
  325.        
  326.          echo "\n";
  327.      }
  328.  
  329.    
  330. }
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339. /**
  340.  * Enqueue scripts and styles
  341.  */
  342. function progression_scripts() {
  343.     wp_enqueue_style( 'style', get_stylesheet_uri() );
  344.     wp_enqueue_style( 'responsive', get_template_directory_uri() . '/css/responsive.css', array( 'style' ) );
  345.     wp_enqueue_style( 'shortcodes', get_template_directory_uri() . '/css/shortcodes.css', array( 'style' ) );
  346.     wp_enqueue_style( 'google-fonts', 'http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic', array( 'style' ) );
  347.  
  348.     wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/libs/modernizr-2.0.6.min.js', false, '20120206', false );
  349.     wp_enqueue_script( 'plugins', get_template_directory_uri() . '/js/plugins.js', array( 'jquery' ), '20120206', false );
  350.     wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), '20120206', false );
  351.     wp_enqueue_script( 'shortcodes', get_template_directory_uri() . '/js/progression-shortcodes-lib.js', array( 'jquery' ), '20120206', false );
  352.  
  353.     if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
  354.         wp_enqueue_script( 'comment-reply' );
  355.     }
  356.    
  357.     if ( is_page_template('page-contact.php' && 'page-contact-full.php')  ) {
  358.         wp_enqueue_script( 'google-maps', 'http://maps.google.com/maps/api/js?sensor=true', false, '20120206', false );
  359.         wp_enqueue_script( 'go-mapsapi', get_template_directory_uri() . '/js/jquery.gomap-1.3.2.min.js', array( 'google-maps' ), '20120206', false );
  360.     }
  361. }
  362. add_action( 'wp_enqueue_scripts', 'progression_scripts' );
  363.  
  364.  
  365.  
  366. function whiterock_customize_register($wp_customize)
  367. {
  368.    
  369.     $wp_customize->add_section( 'whiterock_text_scheme' , array(
  370.         'title'      => __('Font Colors','progression'),
  371.         'priority'   => 35,
  372.     ) );
  373.    
  374.     $wp_customize->add_setting('body_text', array(
  375.         'default'     => '#5f6567'
  376.     ));
  377.    
  378.    
  379.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'body_text', array(
  380.         'label'        => __( 'Body Default Font Color', 'progression' ),
  381.         'section'    => 'whiterock_text_scheme',
  382.         'settings'   => 'body_text',
  383.         'priority'   => 10,
  384.     )));
  385.    
  386.    
  387.     $wp_customize->add_setting('navigation_text', array(
  388.         'default'     => '#000000'
  389.     ));
  390.    
  391.    
  392.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'navigation_text', array(
  393.         'label'        => __( 'Navigation Font Color', 'progression' ),
  394.         'section'    => 'whiterock_text_scheme',
  395.         'settings'   => 'navigation_text',
  396.         'priority'   => 20,
  397.     )));
  398.    
  399.     $wp_customize->add_setting('navigation_text_hover', array(
  400.         'default'     => '#ffffff'
  401.     ));
  402.    
  403.    
  404.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'navigation_text_hover', array(
  405.         'label'        => __( 'Navigation Hover/Selected Font Color', 'progression' ),
  406.         'section'    => 'whiterock_text_scheme',
  407.         'settings'   => 'navigation_text_hover',
  408.         'priority'   => 25,
  409.     )));
  410.    
  411.    
  412.     $wp_customize->add_setting('page_title_text', array(
  413.         'default'     => '#ffffff'
  414.     ));
  415.    
  416.    
  417.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'page_title_text', array(
  418.         'label'        => __( 'Page Title Font Color', 'progression' ),
  419.         'section'    => 'whiterock_text_scheme',
  420.         'settings'   => 'page_title_text',
  421.         'priority'   => 30,
  422.     )));
  423.    
  424.    
  425.     $wp_customize->add_setting('link_color', array(
  426.         'default'     => '#5f757e'
  427.     ));
  428.    
  429.    
  430.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_color', array(
  431.         'label'        => __( 'Default Link Font Color', 'progression' ),
  432.         'section'    => 'whiterock_text_scheme',
  433.         'settings'   => 'link_color',
  434.         'priority'   => 40,
  435.     )));
  436.    
  437.    
  438.     $wp_customize->add_setting('link_hover_color', array(
  439.         'default'     => '#88a5b1'
  440.     ));
  441.    
  442.    
  443.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_hover_color', array(
  444.         'label'        => __( 'Default Link Hover Color', 'progression' ),
  445.         'section'    => 'whiterock_text_scheme',
  446.         'settings'   => 'link_hover_color',
  447.         'priority'   => 50,
  448.     )));
  449.    
  450.    
  451.    
  452.     $wp_customize->add_setting('headings_default_color', array(
  453.         'default'     => '#7b7562'
  454.     ));
  455.    
  456.    
  457.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'headings_default_color', array(
  458.         'label'        => __( 'Headings Font Color', 'progression' ),
  459.         'section'    => 'whiterock_text_scheme',
  460.         'settings'   => 'headings_default_color',
  461.         'priority'   => 60,
  462.     )));
  463.    
  464.  
  465.    
  466.    
  467.  
  468.     $wp_customize->add_setting('footer_link_color', array(
  469.         'default'     => '#aca693'
  470.     ));
  471.    
  472.    
  473.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'footer_link_color', array(
  474.         'label'        => __( 'Footer Link Color', 'progression' ),
  475.         'section'    => 'whiterock_text_scheme',
  476.         'settings'   => 'footer_link_color',
  477.         'priority'   => 90,
  478.     )));
  479.    
  480.    
  481.  
  482.    
  483.    
  484.     $wp_customize->add_setting('button_text_color', array(
  485.         'default'     => '#88a5b1'
  486.     ));
  487.    
  488.    
  489.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'button_text_color', array(
  490.         'label'        => __( 'Button Text Link Color', 'progression' ),
  491.         'section'    => 'whiterock_text_scheme',
  492.         'settings'   => 'button_text_color',
  493.         'priority'   => 75,
  494.     )));
  495.    
  496.    
  497.     $wp_customize->add_setting('button_text_color_hover', array(
  498.         'default'     => '#ffffff'
  499.     ));
  500.    
  501.    
  502.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'button_text_color_hover', array(
  503.         'label'        => __( 'Button Text Hover Link Color', 'progression' ),
  504.         'section'    => 'whiterock_text_scheme',
  505.         'settings'   => 'button_text_color_hover',
  506.         'priority'   => 80,
  507.     )));
  508.    
  509.    
  510.     $wp_customize->add_section( 'whiterock_color_scheme' , array(
  511.         'title'      => __('Background Colors','progression'),
  512.         'priority'   => 30,
  513.     ) );
  514.    
  515.     $wp_customize->add_setting('header_bg', array(
  516.         'default'     => '#6c858a'
  517.     ));
  518.    
  519.    
  520.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'header_bg', array(
  521.         'label'        => __( 'Navigation Background Color', 'progression' ),
  522.         'section'    => 'whiterock_color_scheme',
  523.         'settings'   => 'header_bg',
  524.         'priority'   => 1,
  525.     )));
  526.    
  527.    
  528.     $wp_customize->add_setting('page_title_line_background', array(
  529.         'default'     => '#88a5b1'
  530.     ));
  531.    
  532.    
  533.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'page_title_line_background', array(
  534.         'label'        => __( 'Header Divider Background Highlight', 'progression' ),
  535.         'section'    => 'whiterock_color_scheme',
  536.         'settings'   => 'page_title_line_background',
  537.         'priority'   => 5,
  538.     )));
  539.    
  540.    
  541.    
  542.     $wp_customize->add_setting('page_title_background', array(
  543.         'default'     => '#576e78'
  544.     ));
  545.    
  546.    
  547.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'page_title_background', array(
  548.         'label'        => __( 'Page Title Background Highlight', 'progression' ),
  549.         'section'    => 'whiterock_color_scheme',
  550.         'settings'   => 'page_title_background',
  551.         'priority'   => 10,
  552.     )));
  553.    
  554.  
  555.     $wp_customize->add_setting('content_bg', array(
  556.         'default'     => '#f2f1ed'
  557.     ));
  558.    
  559.    
  560.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'content_bg', array(
  561.         'label'        => __( 'Body FallBack Background Color', 'progression' ),
  562.         'section'    => 'whiterock_color_scheme',
  563.         'settings'   => 'content_bg',
  564.         'priority'   => 30,
  565.     )));
  566.    
  567.    
  568.    
  569.     $wp_customize->add_setting('footer_bg', array(
  570.         'default'     => '#bdb7a4'
  571.     ));
  572.    
  573.    
  574.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'footer_bg', array(
  575.         'label'        => __( 'Footer Base Background Highlight', 'progression' ),
  576.         'section'    => 'whiterock_color_scheme',
  577.         'settings'   => 'footer_bg',
  578.         'priority'   => 50,
  579.     )));
  580.    
  581.    
  582.     $wp_customize->add_setting('footer_top_bg', array(
  583.         'default'     => '#e3e0d9'
  584.     ));
  585.    
  586.    
  587.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'footer_top_bg', array(
  588.         'label'        => __( 'Footer Widget Area Background Color', 'progression' ),
  589.         'section'    => 'whiterock_color_scheme',
  590.         'settings'   => 'footer_top_bg',
  591.         'priority'   => 40,
  592.     )));
  593.    
  594.    
  595.     $wp_customize->add_setting('button_bg', array(
  596.         'default'     => '#ffffff'
  597.     ));
  598.    
  599.    
  600.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'button_bg', array(
  601.         'label'        => __( 'Button Background Color', 'progression' ),
  602.         'section'    => 'whiterock_color_scheme',
  603.         'settings'   => 'button_bg',
  604.         'priority'   => 60,
  605.     )));
  606.    
  607.    
  608.    
  609.     $wp_customize->add_setting('button_hover_bg', array(
  610.         'default'     => '#aacedd'
  611.     ));
  612.    
  613.    
  614.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'button_hover_bg', array(
  615.         'label'        => __( 'Button Hover Background Color', 'progression' ),
  616.         'section'    => 'whiterock_color_scheme',
  617.         'settings'   => 'button_hover_bg',
  618.         'priority'   => 70,
  619.     )));
  620.    
  621.    
  622.     $wp_customize->add_setting('hightlight_bg', array(
  623.         'default'     => '#88a5b1'
  624.     ));
  625.    
  626.    
  627.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'hightlight_bg', array(
  628.         'label'        => __( 'Container Border Bottom Highlight', 'progression' ),
  629.         'section'    => 'whiterock_color_scheme',
  630.         'settings'   => 'hightlight_bg',
  631.         'priority'   => 80,
  632.     )));
  633.    
  634.    
  635.     $wp_customize->add_setting('secondary_hightlight_bg', array(
  636.         'default'     => '#bdb7a4'
  637.     ));
  638.    
  639.    
  640.     $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'secondary_hightlight_bg', array(
  641.         'label'        => __( 'Header Underline and Sidebar Border Color', 'progression' ),
  642.         'section'    => 'whiterock_color_scheme',
  643.         'settings'   => 'secondary_hightlight_bg',
  644.         'priority'   => 80,
  645.     )));
  646.    
  647. }
  648. add_action('customize_register', 'whiterock_customize_register');
  649.  
  650.  
  651. function whiterock_customize_css()
  652. {
  653.     ?>
  654.  
  655. <style type="text/css">
  656. .sf-menu ul, .sf-menu li.current-menu-item, .sf-menu a:hover, .sf-menu li a:hover, .sf-menu a:hover, .sf-menu a:visited:hover, .sf-menu li.sfHover a, .sf-menu li.sfHover a:visited {background-color:<?php echo get_theme_mod('header_bg', '#6c858a'); ?>;  }
  657. #header-top-bar, #page-title-divider { background:<?php echo get_theme_mod('page_title_line_background', '#88a5b1'); ?>; }
  658. #page-title h1 {border-bottom:8px solid <?php echo get_theme_mod('page_title_background', '#576e78'); ?>; }
  659. .widget-area-highlight  {background:<?php echo get_theme_mod('footer_top_bg', '#e3e0d9'); ?>; }
  660. #copyright { border-top-color:<?php echo get_theme_mod('footer_bg', '#bdb7a4'); ?>;  }
  661. #tweets-sidebar {background:<?php echo get_theme_mod('content_bg', '#f2f1ed'); ?>;}
  662. #tweets-sidebar:before {border-top: 10px solid <?php echo get_theme_mod('content_bg', '#f2f1ed'); ?>;}
  663. body, footer, #main { background-color:<?php echo get_theme_mod('content_bg', '#f2f1ed'); ?>;}
  664. #main img, #map-contact, .video-container, .video-post-image {border-bottom:5px solid <?php echo get_theme_mod('hightlight_bg', '#88a5b1'); ?>;}
  665. .menu-item-container {border-bottom:4px solid <?php echo get_theme_mod('hightlight_bg', '#88a5b1'); ?>; }
  666. body ul#open-hours li, body #main ul.menu-items li, .type-post {border-bottom:1px dotted <?php echo get_theme_mod('secondary_hightlight_bg', '#bdb7a4'); ?>; }
  667. .header-underline {border-bottom:3px solid <?php echo get_theme_mod('secondary_hightlight_bg', '#bdb7a4'); ?>;}
  668. #sidebar {border-left:1px dotted <?php echo get_theme_mod('secondary_hightlight_bg', '#bdb7a4'); ?>;}
  669. body {color:<?php echo get_theme_mod('body_text', '#5f6567'); ?>;}
  670. a {color:<?php echo get_theme_mod('link_color', '#5f757e'); ?>;}
  671. a:hover, #copyright li a:hover {color:<?php echo get_theme_mod('link_hover_color', '#88a5b1'); ?>;}
  672. h1, h2, h3, h4, h5, h6 {color:<?php echo get_theme_mod('headings_default_color', '#7b7562'); ?>;}
  673. .sf-menu a, .sf-menu a:visited  {color: <?php echo get_theme_mod('navigation_text', '#000000'); ?>;}
  674. .sf-menu li.current-menu-item a, .sf-menu li.current-menu-item a:visited, .sf-menu a:hover, .sf-menu li a:hover, .sf-menu a:hover, .sf-menu a:visited:hover, .sf-menu li.sfHover a, .sf-menu li.sfHover a:visited {color:<?php echo get_theme_mod('navigation_text_hover', '#ffffff'); ?>;}
  675. #page-title h1 {color:<?php echo get_theme_mod('page_title_text', '#ffffff'); ?>;}
  676. #copyright li a {color:<?php echo get_theme_mod('footer_link_color', '#aca693'); ?>;}
  677. .wpcf7  input.wpcf7-submit, ul.filter-children li a, a.rock-button, input.button, .pagination a, .social-icons a, .rock-button, a .rock-button, #respond input#submit, body #main a.progression-grey {
  678.     color:<?php echo get_theme_mod('button_text_color', '#88a5b1'); ?>;
  679.     background:<?php echo get_theme_mod('button_bg', '#ffffff'); ?>;
  680.     border-bottom:2px solid <?php echo get_theme_mod('button_hover_bg', '#aacedd'); ?>;
  681. }
  682. .rock-button a {color:<?php echo get_theme_mod('button_text_color', '#88a5b1'); ?>; }
  683. .wpcf7  input.wpcf7-submit:hover, ul.filter-children li a:hover, ul.filter-children li.current_page_item a, #respond input#submit:hover, .rock-button:hover, a.rock-button:hover, .social-icons a:hover, input.button:hover, .pagination a:hover, .pagination a.selected, .social-icons a:hover, body #main a.progression-grey:hover
  684. {background:<?php echo get_theme_mod('button_hover_bg', '#aacedd'); ?>;
  685. color:<?php echo get_theme_mod('button_text_color_hover', '#ffffff'); ?>;
  686. border-bottom:2px solid <?php echo get_theme_mod('button_hover_bg', '#aacedd'); ?>;
  687. }
  688. .rock-button:hover a {color:<?php echo get_theme_mod('button_text_color_hover', '#ffffff'); ?>;}
  689. </style>
  690.     <?php
  691. }
  692. add_action('wp_head', 'whiterock_customize_css');
Advertisement
Add Comment
Please, Sign In to add comment