ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

inner-pages.php (3677B)


      1 <?php
      2 
      3 function materialis_inner_pages_header_content_options($section, $prefix, $priority)
      4 {
      5 
      6     materialis_add_kirki_field(array(
      7         'type'     => 'sectionseparator',
      8         'label'    => esc_html__('Content', 'materialis'),
      9         'section'  => $section,
     10         'settings' => 'inner_header_content_options_separator',
     11         'priority' => $priority,
     12     ));
     13 
     14     materialis_add_kirki_field(array(
     15         'type'     => 'radio-buttonset',
     16         'label'    => esc_html__('Text Align', 'materialis'),
     17         'section'  => $section,
     18         'settings' => 'inner_header_text_align',
     19         'default'  => 'center',
     20         'priority' => $priority,
     21         'choices'  => array(
     22             'left'   => esc_html__('Left', 'materialis'),
     23             'center' => esc_html__('Center', 'materialis'),
     24             'right'  => esc_html__('Right', 'materialis'),
     25         ),
     26         'output' => array(
     27             array(
     28                 'element'     => '.inner-header-description',
     29                 'property'    => 'text-align',
     30                 'suffix'      => '!important',
     31                 'media_query' => '@media only screen and (min-width: 768px)',
     32             ),
     33 
     34         ),
     35         'transport' => 'postMessage',
     36         'js_vars' => array(
     37             array(
     38                 'element'  => '.inner-header-description',
     39                 'function' => 'css',
     40                 'suffix'   => '!important',
     41                 'property' => 'text-align',
     42             ),
     43         ),
     44     ));
     45 
     46     materialis_add_kirki_field(array(
     47         'type'     => 'spacing',
     48         'label'    => esc_html__('Content Spacing', 'materialis'),
     49         'section'  => $section,
     50         'settings' => 'inner_header_spacing',
     51         'default' => array(
     52             'top'    => '8%',
     53             'bottom' => '8%',
     54         ),
     55         'output' => array(
     56             array(
     57                 'element'  => '.inner-header-description',
     58                 'property' => 'padding',
     59                 'suffix'   => ' !important',
     60             ),
     61         ),
     62         'transport' => 'postMessage',
     63         'js_vars'  => array(
     64             array(
     65                 'element'  => '.inner-header-description',
     66                 'function' => 'css',
     67                 'property' => 'padding',
     68                 'suffix'   => ' !important',
     69             ),
     70         ),
     71         'priority' => $priority,
     72     ));
     73 
     74 
     75     materialis_add_kirki_field(array(
     76         'type'     => 'checkbox',
     77         'settings' => 'inner_header_show_subtitle',
     78         'label'    => esc_html__('Show subtitle (blog description)', 'materialis'),
     79         'section'  => $section,
     80         'default'  => true,
     81         'priority' => $priority+1,
     82     ));
     83 }
     84 
     85 
     86 /*
     87     template functions
     88 */
     89 
     90 
     91 function materialis_print_inner_pages_header_content()
     92 {
     93     do_action('materialis_before_inner_page_header_content');
     94     ?>
     95     <div class="inner-header-description gridContainer">
     96         <div class="row header-description-row">
     97             <div class="col-xs col-xs-12">
     98                 <h1 class="hero-title">
     99                     <?php echo materialis_title(); ?>
    100                 </h1>
    101                 <?php
    102                 $show_subtitle = materialis_get_theme_mod('inner_header_show_subtitle', true);
    103                 $show_subtitle = apply_filters('inner_header_show_subtitle', $show_subtitle);
    104 
    105                 if ($show_subtitle && materialis_post_type_is(array('post', 'attachment'))):
    106                     ?>
    107                     <p class="header-subtitle"><?php echo esc_html(get_bloginfo('description')); ?></p>
    108                 <?php endif; ?>
    109             </div>
    110 
    111         </div>
    112     </div>
    113     <?php
    114 
    115     do_action('materialis_after_inner_page_header_content');
    116 }