/** * Add a style block to the theme for the current link color. * * This function is attached to the 'wp_head' action hook. * * @since 1.0 */ function lobster_styles() { $lobster_theme_options = lobster_theme_options(); ?> <style> .container, .boxed #page, #main > .row, .home #primary article > .row, .archive #primary article > .row, .search #primary article > .row { max-width: <?php echo $lobster_theme_options['width']; ?> px; } </style> <?php }
<?php /** * The template for displaying posts in the Audio post format. * * @since 1.0 */ $lobster_theme_options = lobster_theme_options(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="row"> <div class="col-md-12"> <?php get_template_part('content', 'header'); ?> <div class="entry-content"> <?php the_content(__('Read more …', 'lobster')); ?> </div><!-- .entry-content --> <?php get_template_part('content', 'footer'); ?>
/** * Create the Custom Header section on the home page * * @since 1.4 */ function lobster_admin_header_image() { global $paged; $lobster_theme_options = lobster_theme_options(); if (!empty($lobster_theme_options['custom_header_display'])) { /** * Displays the Custom header Text */ ?> <div class="displaying-header-text home-jumbotron jumbotron col-xs-12" id="headimg" style="background: url(<?php header_image(); ?> ) no-repeat scroll top; background-size: 1600px auto;"> <h3 class="lobster-ch-intro" style="color:#<?php header_textcolor(); ?> ;"><?php echo $lobster_theme_options['cust_header_headline_title']; ?> </h3> <i style="color:#<?php header_textcolor(); ?> ;" class="jumbo-icon icon-star-empty"></i> <p class="lead"><?php if (is_front_page() || is_home()) { echo $lobster_theme_options['cust_header_headline_text']; } elseif (is_page()) { echo '<small>' . bloginfo('description') . '</small>'; } ?> </p> </div> <?php } }
/** * Create the required classes for the #secondary sidebar container * * @since 1.0 */ function lobster_sidebar_class() { $lobster_theme_options = lobster_theme_options(); $layout = $lobster_theme_options['layout']; if (1 == $layout || 2 == $layout || 6 == $layout) { $end = 2 == $layout ? ' end' : ''; $class = str_replace('col-md-', '', $lobster_theme_options['primary']); $class = 'col-md-' . (12 - $class) . $end; } else { $class = $lobster_theme_options['secondary']; } echo 'class="' . $class . '"'; }
/** * Adds theme options to the Customizer screen * * This function is attached to the 'customize_register' action hook. * * @param class $wp_customize * * @since 1.0 */ public function customize_register($wp_customize) { $lobster_theme_options = lobster_theme_options(); // Layout section panel $wp_customize->add_section('lobster_layout', array('title' => __('Layout', 'lobster'), 'priority' => 35)); $wp_customize->add_setting('lobster_theme_options[width]', array('default' => $lobster_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_width', array('label' => __('Site Width', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1200' => __('1200px', 'lobster'), '960' => __('960px', 'lobster')))); $wp_customize->add_setting('lobster_theme_options[layout]', array('default' => $lobster_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_site_layout', array('label' => __('Site Layout', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[layout]', 'priority' => 15, 'type' => 'radio', 'choices' => array('1' => __('1 Sidebar - Left', 'lobster'), '2' => __('1 Sidebar - Right', 'lobster'), '6' => __('No Sidebars', 'lobster')))); $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%', 'col-md-12' => '100%'); $wp_customize->add_setting('lobster_theme_options[primary]', array('default' => $lobster_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_primary_column', array('label' => __('Main Content', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[primary]', 'priority' => 20, 'type' => 'select', 'choices' => $choices)); $wp_customize->add_setting('lobster_theme_options[excerpt_content]', array('default' => $lobster_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_excerpt_content', array('label' => __('Post Content Display', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'lobster'), 'content' => __('Full Content', 'lobster')))); $wp_customize->add_setting('lobster_theme_options[home_widget]', array('default' => $lobster_theme_options['home_widget'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_home_widget', array('label' => __('Display Home Page Top Widget Area', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[home_widget]', 'priority' => 35, 'type' => 'checkbox')); $wp_customize->add_setting('lobster_theme_options[home_posts]', array('default' => $lobster_theme_options['home_posts'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_home_posts', array('label' => __('Display Home Page Posts', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[home_posts]', 'priority' => 40, 'type' => 'checkbox')); // Jumbo headline section panel $wp_customize->add_section('lobster_jumbo', array('title' => __('Jumbo Headline', 'lobster'), 'priority' => 36)); $wp_customize->add_setting('lobster_theme_options[jumbo_headline_title]', array('default' => $lobster_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_jumbo_headline_title', array('label' => __('Jumbo Headline Title', 'lobster'), 'section' => 'lobster_jumbo', 'settings' => 'lobster_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text')); $wp_customize->add_setting('lobster_theme_options[jumbo_headline_text]', array('default' => $lobster_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_jumbo_headline_text', array('label' => __('Jumbo Headline Text', 'lobster'), 'section' => 'lobster_jumbo', 'settings' => 'lobster_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text')); // Posts panel $wp_customize->add_section('lobster_posts', array('title' => __('Posts', 'lobster'), 'priority' => 45)); $wp_customize->add_setting('lobster_theme_options[display_categories]', array('default' => $lobster_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_display_categories', array('label' => __('Display Categories', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_categories]', 'type' => 'checkbox')); $wp_customize->add_setting('lobster_theme_options[display_author]', array('default' => $lobster_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_display_author', array('label' => __('Display Author', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_author]', 'type' => 'checkbox')); $wp_customize->add_setting('lobster_theme_options[display_date]', array('default' => $lobster_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_display_date', array('label' => __('Display Date', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_date]', 'type' => 'checkbox')); $wp_customize->add_setting('lobster_theme_options[display_comment_count]', array('default' => $lobster_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_display_comment_count', array('label' => __('Display Comment Count', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_comment_count]', 'type' => 'checkbox')); // Custom header section panel $wp_customize->add_section('lobster_cust_header', array('title' => __('Custom Header', 'lobster'), 'priority' => 54)); $wp_customize->add_setting('lobster_theme_options[cust_header_headline_title]', array('default' => $lobster_theme_options['cust_header_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_cust_header_headline_title', array('label' => __('Custom Header Headline Title', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[cust_header_headline_title]', 'priority' => 34, 'type' => 'text')); $wp_customize->add_setting('lobster_theme_options[cust_header_headline_text]', array('default' => $lobster_theme_options['cust_header_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_cust_header_headline_text', array('label' => __('Custom Header Headline Text', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[cust_header_headline_text]', 'priority' => 38, 'type' => 'text')); $wp_customize->add_setting('lobster_theme_options[custom_header_display]', array('default' => $lobster_theme_options['custom_header_display'], 'type' => 'option', 'capability' => 'edit_theme_options')); $wp_customize->add_control('lobster_cust_header_display', array('label' => __('Display Custom Header and Header Image (This box must be ticked to enable the Header Image feature below.)', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[custom_header_display]', 'priority' => 25, 'type' => 'checkbox')); }