Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.30 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The header for our theme
  4.  *
  5.  * This is the template that displays all of the <head> section and everything up until <div id="content">
  6.  *
  7.  * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
  8.  *
  9.  * @package seo
  10.  */
  11.  
  12. ?>
  13.     <!DOCTYPE html>
  14.     <html <?php language_attributes(); ?>>
  15.  
  16.     <head>
  17.         <meta charset="<?php bloginfo( 'charset' ); ?>">
  18.         <meta name="viewport" content="width=device-width, initial-scale=1">
  19.         <link rel="profile" href="http://gmpg.org/xfn/11">
  20.  
  21.         <?php
  22.        
  23.         $header_iconic_boxes = cs_get_option('header_iconic_boxes');
  24.         $social_links = cs_get_option('social_links');
  25.         $enable_image_logo = cs_get_option('enable_image_logo');
  26.         $image_logo = cs_get_option('image_logo');
  27.         $image_logo_max_height = cs_get_option('image_logo_max_height');
  28.         $text_logo = cs_get_option('text_logo');
  29.        
  30.         wp_head(); ?>
  31.     </head>
  32.  
  33.     <body <?php body_class(); ?>>
  34.         <div id="page" class="site">
  35.             <div class="header-area">
  36.                 <div class="header-top">
  37.                     <div class="container">
  38.                         <div class="row">
  39.                             <div class="col-md-6">
  40.                                 <?php if(!empty($social_links)) : ?>
  41.                                     <div class="social-links">
  42.                                         <?php foreach($social_links as $link) : ?>
  43.                                             <a href="<?php echo $link['link']?>" target="_blank"><i class="<?php echo $link['social_icon']?>"></i></a><span class="seperator">|</span>
  44.                                             <?php endforeach; ?>
  45.                                     </div>
  46.                                     <?php endif; ?>
  47.                             </div>
  48.                             <div class="col-md-6">
  49.  
  50.                                 <?php if(!empty($header_iconic_boxes)) : ?>
  51.                                     <div class="quick-contact text-right">
  52.                                         <?php foreach($header_iconic_boxes as $box) : ?>
  53.                                             <?php if(!empty($box['link'])) : ?>
  54.                                                 <a href="<?php echo $box['link']; ?>" <?php else : ?>
  55.                                                     <?php endif; ?>>
  56.                                                         <i class="<?php echo $box['icon']; ?>"></i>
  57.                                                         <?php echo $box['title']; ?>
  58.                                                 </a><span class="separator">|</span>
  59.                                                 <?php if(!empty($box['link'])) : ?>
  60.                                                     </a>
  61.                                                     <?php else : ?>
  62.  
  63.                                                         <?php endif;?>
  64.                                                             <?php endforeach; ?>
  65.                                     </div>
  66.                                     <?php endif; ?>
  67.                                         <!--<a href="tel:+22 666-888-999"><i class="fa fa-phone"></i>+22 666-888-999</a><span class="separator">|</span>
  68.                                                     <a href="mailto:seoexpert@gmail.com"><i class="fa fa-envelope"></i>seoexpert@gmail.com</a>-->
  69.  
  70.                             </div>
  71.  
  72.                         </div>
  73.                     </div>
  74.                 </div>
  75.  
  76.                 <div class="header-bottom">
  77.                     <div class="container">
  78.                         <div class="row">
  79.                             <div class="col-md-2">
  80.                                 <div class="site-logo">
  81.                                     <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
  82.  
  83.                                         <?php if( $enable_image_logo == true && !empty ($image_logo) ) : $image_logo_src = wp_get_attachment_image_src ($image_logo, 'large', false); ?>
  84.                                             <img style="max-height:<?php echo $image_logo_max_height; ?>px" src="<?php echo $image_logo_src[0]; ?>" alt="<?php echo bloginfo( 'name' ) ?>">
  85.  
  86.                                             <?php else : ?>
  87.                                                 <?php if(!empty ($text_logo) ) {echo $text_logo;} else {bloginfo( 'name' );} ?>
  88.                                                     <?php endif; ?>
  89.                                     </a>
  90.                                 </div>
  91.                             </div>
  92.                             <div class="col-md-10">
  93.                                 <div class="main-menu text-right">
  94.                                     <?php wp_nav_menu( array(
  95.                                         'theme_location' => 'menu-1',
  96.                                         'menu_id' => 'primary-menu',
  97.                                         )
  98.                                     ); ?>
  99.                                 </div>
  100.                             </div>
  101.                         </div>
  102.                     </div>
  103.                 </div>
  104.             </div>
  105.  
  106.  
  107.  
  108.  
  109. //-------------- theme options------------ //
  110. <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
  111.  
  112.  
  113. function seo_theme_option_settings( $settings ){
  114.     $settings = array();
  115.    
  116.    
  117.     $settings           = array(
  118.         'menu_title'      => 'Theme Options',
  119.         'menu_type'       => 'menu', // menu, submenu, options, theme, etc.
  120.         'menu_slug'       => 'seo-framework',
  121.         'ajax_save'       => true,
  122.         'show_reset_all'  => true,
  123.         'framework_title' => 'seo Framework <small>by seo</small>',
  124.     );
  125.    
  126.     return $settings;
  127. }
  128.  
  129. add_filter('cs_framework_settings', 'seo_theme_option_settings');
  130.  
  131.  
  132.  
  133. function seo_theme_metabox( $options ){
  134.    
  135.     $options      = array(); // remove old options
  136.    
  137. // -----------------------------------------
  138. // Page Metabox Options                    -
  139. // -----------------------------------------
  140. $options[]    = array(
  141.     'id'        => 'seo_page_options',
  142.     'title'     => 'Page Options',
  143.     'post_type' => 'page',
  144.     'context'   => 'normal',
  145.     'priority'  => 'high',
  146.     'sections'  => array(
  147.  
  148.         // begin: a section
  149.             array(
  150.                 'name'  => 'seo_page_options_meta',
  151.                 'icon'  => 'fa fa-cog',
  152.  
  153.                 // begin: fields
  154.                 'fields' => array(
  155.  
  156.                 array(
  157.                     'id'    => 'enable_title',
  158.                     'type'  => 'switcher',
  159.                     'title' => 'enable title?',
  160.                     'default' => true,
  161.                     'desc' => esc_html__('if you want to enable title, select yes', 'seo-infinityy')
  162.                     ),
  163.                 array(
  164.                     'id'    => 'custom_title',
  165.                     'type'  => 'text',
  166.                     'title' => 'custom title?',
  167.                     'dependency' => array('enable_title', '==', 'true'),
  168.                     'desc' => esc_html__('if you want to enable title, select yes', 'seo-infinityy')
  169.                     ),
  170.                 ),
  171.             ),
  172.         ),
  173.     );
  174.    
  175. // -----------------------------------------
  176. // Slide Options                    -
  177. // -----------------------------------------
  178. $options[]    = array(
  179.   'id'        => 'seo_slider_options',
  180.   'title'     => 'Slider Options',
  181.   'post_type' => 'slider',
  182.   'context'   => 'normal',
  183.   'priority'  => 'high',
  184.   'sections'  => array(
  185.  
  186.     // begin: a section
  187.     array(
  188.       'name'  => 'seo_slider_options_meta',
  189.  
  190.       // begin: fields
  191.       'fields' => array(
  192.  
  193.         array(
  194.                'id'              => 'buttons',
  195.                'type'            => 'group',
  196.                'title'           => 'Slider button',
  197.                'button_title'    => 'Add New',
  198.                'accordion_title' => 'Add New Button',
  199.                'fields'          => array(
  200.                     array(
  201.                     'id'    => 'type',
  202.                     'type'  => 'select',
  203.                     'title' => 'button type',
  204.                         'options'  => array(
  205.                             'Bordred'  => 'Borderred button',
  206.                             'Filled'   => 'Filled button',
  207.                         ),
  208.                     ),
  209.                     array(
  210.                     'id'    => 'text',
  211.                     'type'  => 'text',
  212.                     'title' => 'Button Ext',
  213.                     'default' => 'get started'
  214.                     ),
  215.                     array(
  216.                     'id'    => 'link_type',
  217.                     'type'  => 'select',
  218.                     'title' => 'link type',
  219.                         'options'  => array(
  220.                             '1'  => 'wordpress page',
  221.                             '2'   => 'External link',
  222.                         ),
  223.                     ),
  224.                     array(
  225.                     'id'    => 'link_to_page',
  226.                     'type'  => 'select',
  227.                     'title' => 'select page',
  228.                     'options'  => 'page',
  229.                     'dependency' => array('link_type', '==', '1'),
  230.                     ),
  231.                     array(
  232.                     'id'    => 'link_to_external',
  233.                     'type'  => 'text',
  234.                     'title' => 'Type url',
  235.                     'dependency' => array('link_type', '==', '2'),
  236.                     ),
  237.                 ),
  238.             ),  
  239.             array(
  240.                 'id'    => 'enable_overlay',
  241.                 'type'  => 'switcher',
  242.                 'title' => 'Enable Overlay ?',
  243.                 'default' => true,
  244.                 'label' => 'Do you want to it ?',
  245.             ),
  246.             array(
  247.                 'id'    => 'overlay_percentage',
  248.                 'type'  => 'text',
  249.                 'title' => 'Overlay percentage',
  250.                 'default' => '.7',
  251.                 'desc' => 'type overlay percentage in number',
  252.                 'dependency'   => array( 'enable_overlay', '==', 'true' ),
  253.             ),
  254.             array(
  255.                 'id'    => 'overlay_color',
  256.                 'type'  => 'color_picker',
  257.                 'title' => 'Overlay color',
  258.                 'default' => '#999',
  259.                 'desc' => 'select overlay color',
  260.                 'dependency'   => array( 'enable_overlay', '==', 'true' ),
  261.             ),
  262.             array(
  263.                 'id'    => 'title_spcl',
  264.                 'type'  => 'text',
  265.                 'title' => 'Colored Title',
  266.                 'default' => 'we measure',
  267.                 'desc' => 'type colored text of title',
  268.             ),
  269.             array(
  270.                 'id'    => 'sub_title',
  271.                 'type'  => 'text',
  272.                 'title' => 'subtitle text',
  273.                 'default' => 'Exceptional result',
  274.                 'desc' => 'Type subtitle text',
  275.             ),
  276.         ),
  277.     ),
  278.   ),
  279. );
  280.    
  281.     return $options;
  282.    
  283. }
  284. add_filter('cs_metabox_options', 'seo_theme_metabox');
  285.  
  286.  
  287.  
  288.  
  289. function seo_theme_options ($options){
  290.    
  291.     $options      = array(); // remove old theme options
  292.    
  293.     $options[]    = array(
  294.         'name'      => 'seo_infinityy_header_section',
  295.         'title'     => 'header Section',
  296.         'icon'      => 'fa fa-heart',
  297.         'fields'    => array(
  298.             array(
  299.                 'id'              => 'header_iconic_boxes',
  300.                 'type'            => 'group',
  301.                 'title'           => 'Iconic boxes',
  302.                 'desc'           => 'If you want to show iconic boxes in header section',
  303.                 'button_title'    => 'Add New',
  304.                 'accordion_title' => 'Add New box',
  305.                 'fields'          => array(
  306.                     array(
  307.                       'id'    => 'icon',
  308.                       'type'  => 'icon',
  309.                       'title' => 'box icon',
  310.                     ),
  311.                     array(
  312.                       'id'    => 'title',
  313.                       'type'  => 'text',
  314.                       'title' => 'box title',
  315.                     ),
  316.                     array(
  317.                       'id'    => 'link',
  318.                       'type'  => 'text',
  319.                       'title' => 'box link',
  320.                       'desc' => 'leave blank if you do not want a link',
  321.                     ),
  322.                 ),
  323.             ),
  324.         )
  325.     );
  326.    
  327.     $options[]    = array(
  328.         'name'      => 'seo_infinityy_social_link_section',
  329.         'title'     => 'social link Section',
  330.         'icon'      => 'fa fa-heart',
  331.         'fields'    => array(
  332.             array(
  333.                 'id'              => 'social_links',
  334.                 'type'            => 'group',
  335.                 'title'           => 'social links',
  336.                 'button_title'    => 'Add New',
  337.                 'accordion_title' => 'Add New link',
  338.                 'fields'          => array(
  339.                     array(
  340.                       'id'    => 'social_icon',
  341.                       'type'  => 'icon',
  342.                       'title' => 'social icon',
  343.                     ),
  344.                     array(
  345.                       'id'    => 'link',
  346.                       'type'  => 'text',
  347.                       'title' => 'social link',
  348.                     ),
  349.                 ),
  350.             ),
  351.         )
  352.     );
  353.    
  354.     $options[]    = array(
  355.         'name'      => 'seo_infinityy_logo_section',
  356.         'title'     => 'logo Section',
  357.         'icon'      => 'fa fa-heart',
  358.         'fields'    => array(
  359.             array(
  360.               'id'    => 'enable_image_logo',
  361.               'type'  => 'switcher',
  362.               'title' => 'enable image logo',
  363.               'default' => true,
  364.             ),
  365.             array(
  366.               'id'    => 'image_logo',
  367.               'type'  => 'image',
  368.               'title' => 'upload image logo',
  369.               'dependency' => array('enable_image_logo', '==', 'true'),
  370.             ),
  371.             array(
  372.               'id'    => 'image_logo_max_height',
  373.               'type'  => 'text',
  374.               'default'  => '100',
  375.               'title' => 'logo maximum height',
  376.               'desc' => 'type logo maximum height in px',
  377.               'dependency' => array('enable_image_logo', '==', 'true'),
  378.             ),
  379.             array(
  380.               'id'    => 'text_logo',
  381.               'type'  => 'text',
  382.               'title' => 'logo text',
  383.               'default' => 'seo',
  384.               'dependency' => array('enable_image_logo', '==', 'false'),
  385.             ),
  386.         )
  387.     );
  388.    
  389.     $options[]    = array(
  390.         'name'      => 'seo_infinityy_typography_section',
  391.         'title'     => 'typography Section',
  392.         'icon'      => 'fa fa-heart',
  393.         'fields'    => array(
  394.             array(
  395.                 'id'        => 'body_font',
  396.                 'type'      => 'typography',
  397.                 'title'     => 'body font',
  398.                 'default'   => array(
  399.                     'family'  => 'Roboto',
  400.                     'variant' => '400',
  401.                     'font'    => 'google', // this is helper for output
  402.                 ),
  403.             ),
  404.             array(
  405.                 'id'        => 'heading_font',
  406.                 'type'      => 'typography',
  407.                 'title'     => 'heading font',
  408.                 'default'   => array(
  409.                     'family'  => 'Noto Serif',
  410.                     'variant' => '700',
  411.                     'font'    => 'google', // this is helper for output
  412.                 ),
  413.             ),
  414.         )
  415.     );
  416.    
  417.     $options[]    = array(
  418.         'name'      => 'seo_infinityy_styling_section',
  419.         'title'     => 'styling Section',
  420.         'icon'      => 'fa fa-heart',
  421.         'fields'    => array(
  422.             array(
  423.                 'id'        => 'enable_preloader',
  424.                 'type'      => 'switcher',
  425.                 'title'     => 'enable preloaer',
  426.                 'default'   => true,
  427.             ),
  428.             array(
  429.                 'id'        => 'enable_boxed_layout',
  430.                 'type'      => 'switcher',
  431.                 'title'     => 'enable box layout',
  432.                 'default'   => false
  433.             ),
  434.             array(
  435.                 'id'        => 'body_bg',
  436.                 'type'      => 'image',
  437.                 'title'     => 'body background image',
  438.                 'dependency' => array('enable_boxed_layout', '==', 'false'),
  439.             ),
  440.             array(
  441.                 'id'        => 'body_bg_repeat',
  442.                 'type'      => 'select',
  443.                 'default'      => 'repeat',
  444.                 'options'      => array(
  445.                     'repeat' => 'repeat',
  446.                     'no-repeat' => 'no-repeat',
  447.                     'cover' => 'Cover',
  448.                 ),
  449.                 'title'     => 'body background image repeat',
  450.                 'dependency' => array('enable_boxed_layout', '==', 'false'),
  451.             ),
  452.             array(
  453.                 'id'        => 'body_bg_attachment',
  454.                 'type'      => 'select',
  455.                 'options'      => array(
  456.                     'scroll' => 'Scroll',
  457.                     'fixed' => 'Fixed',
  458.                 ),
  459.                 'title'     => 'body background attachment',
  460.                 'dependency' => array('enable_boxed_layout', '==', 'false'),
  461.             ),
  462.         )
  463.     );
  464.    
  465.     $options[]    = array(
  466.         'name'      => 'seo_infinityy_blog_section',
  467.         'title'     => 'blog Section',
  468.         'icon'      => 'fa fa-heart',
  469.         'fields'    => array(
  470.             array(
  471.                 'id'        => 'display_post_by',
  472.                 'type'      => 'switcher',
  473.                 'title'     => 'Display post by?',
  474.                 'default'   => true,
  475.             ),
  476.             array(
  477.                 'id'        => 'display_post_date',
  478.                 'type'      => 'switcher',
  479.                 'title'     => 'Display post date?',
  480.                 'default'   => true,
  481.             ),
  482.             array(
  483.                 'id'        => 'display_post_comment',
  484.                 'type'      => 'switcher',
  485.                 'title'     => 'Display post comment count?',
  486.                 'default'   => true,
  487.             ),
  488.             array(
  489.                 'id'        => 'display_post_category',
  490.                 'type'      => 'switcher',
  491.                 'title'     => 'Display posted in categories?',
  492.                 'default'   => true,
  493.             ),
  494.             array(
  495.                 'id'        => 'display_post_tag',
  496.                 'type'      => 'switcher',
  497.                 'title'     => 'Display posted in tag?',
  498.                 'default'   => true,
  499.             ),
  500.             array(
  501.                 'id'        => 'display_post_nav',
  502.                 'type'      => 'switcher',
  503.                 'title'     => 'Enable next prev nav link on single page?',
  504.                 'default'   => true,
  505.             ),
  506.         )
  507.     );
  508.    
  509.     $options[]    = array(
  510.         'name'      => 'seo_infinityy_footer_section',
  511.         'title'     => 'footer Section',
  512.         'icon'      => 'fa fa-heart',
  513.         'fields'    => array(
  514.             array(
  515.                 'id'        => 'footer_bg',
  516.                 'type'      => 'color_picker',
  517.                 'title'     => 'footer background color?',
  518.                 'default'   => '#333',
  519.             ),
  520.             array(
  521.                 'id'        => 'footer_bg_image',
  522.                 'type'      => 'image',
  523.                 'title'     => 'footer background image?',
  524.                 'dependency'   => array('footer_bg', '==', 'false'),
  525.             ),
  526.             array(
  527.                 'id'        => 'footer_bg_repeat',
  528.                 'type'      => 'select',
  529.                 'default'      => 'repeat',
  530.                 'options'      => array(
  531.                     'repeat' => 'repeat',
  532.                     'no-repeat' => 'no-repeat',
  533.                     'cover' => 'Cover',
  534.                 ),
  535.                 'title'     => 'footer background image repeat',
  536.                 'dependency' => array('footer_bg', '==', 'false'),
  537.             ),
  538.             array(
  539.                 'id'        => 'footer_bg_attachment',
  540.                 'type'      => 'select',
  541.                 'options'      => array(
  542.                     'scroll' => 'Scroll',
  543.                     'fixed' => 'Fixed',
  544.                 ),
  545.                 'title'     => 'footer background attachment',
  546.                 'dependency' => array('footer_bg', '==', 'false'),
  547.             ),
  548.             array(
  549.                 'id'        => 'footer_heading_text',
  550.                 'type'      => 'color_picker',
  551.                 'title'     => 'footer heading text color?',
  552.                 'default'   => '#fff',
  553.             ),
  554.             array(
  555.                 'id'        => 'footer_copyright_text',
  556.                 'type'      => 'textarea',
  557.                 'title'     => 'footer copyright text',
  558.                 'default'   => 'Copyright2016, All Rights Reserved',
  559.             ),
  560.         )
  561.     );
  562.    
  563.     $options[]    = array(
  564.         'name'      => 'seo_infinityy_scripts_section',
  565.         'title'     => 'scripts Section',
  566.         'icon'      => 'fa fa-heart',
  567.         'fields'    => array(
  568.             array(
  569.                 'id'        => 'head_scripts',
  570.                 'type'      => 'textarea',
  571.                 'title'     => 'head scripts',
  572.                 'sanitize'   => false,
  573.                 'desc'   => 'head scripts goes before closing </ head >',
  574.                
  575.             ),
  576.             array(
  577.                 'id'        => 'body_start_scripts',
  578.                 'type'      => 'textarea',
  579.                 'title'     => 'body start scripts',
  580.                 'sanitize'   => false,
  581.                 'desc'   => 'body scripts goes just after < body > starts',
  582.                
  583.             ),
  584.             array(
  585.                 'id'        => 'body_end_scripts',
  586.                 'type'      => 'textarea',
  587.                 'title'     => 'footer scripts',
  588.                 'sanitize'   => false,
  589.                 'desc'   => 'body scripts goes just before < /body >',
  590.             ),
  591.         )
  592.     );
  593.    
  594.     return $options;
  595. }
  596.  
  597. add_filter('cs_framework_options', 'seo_theme_options');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement