'', 'favicon' => '', 'footer' => '', 'showcase-image' => '', 'showcase-title' => '', 'showcase-text' => '', 'showcase-link' => '', 'menu-color' => '#caeffc', 'header-color' => 'transparent', 'menu-font-color' => '#333', 'widgets-menus-color' => '#f2f2f2', 'footer-color' => '#b7d3e5', 'link-color' => '#000', 'content-link-color' => '#cc0000', 'bg-color' => 'transparent', 'showcase-color' => '#f5fefe', 'showcase-font-color' => '#777', 'showcase' => '0', 'comments' => '1', 'reset' => '0' ); return $defaults; } /********************************* Excerpts fix *******************************/ add_filter('excerpt_more', 'softlights_new_excerpt_more'); function softlights_new_excerpt_more( $more ) { return ''; } function softlights_excerpt() { if( strpos( get_the_content(), 'more-link' ) === false ) { the_excerpt(); } else { the_content('Continue Reading »'); } } /***************************** Admin Theme Options Scripts *************************/ add_action( 'admin_enqueue_scripts', 'softlights_admin_scripts' ); function softlights_admin_scripts($hook) { if('appearance_page_sl-theme-options' != $hook) { return; } wp_enqueue_script( 'iris',get_template_directory_uri().'/js/iris.min.js' ); wp_enqueue_script( 'iris-init',get_template_directory_uri().'/js/iris-init.js' ); wp_enqueue_style ('admin-css', get_template_directory_uri() . '/admin-style.css'); wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); wp_enqueue_script('uploader', get_template_directory_uri().'/js/uploader.js'); } /************************* Theme Custom Colors ************************************/ function softlights_custom_styles() { $softlights_options = get_option('softlights-options'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } add_action('wp_head','softlights_custom_styles'); /********************************** Theme Setup scripts, Fonts and styles ************************************/ function softlights_scripts_styles() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_register_style('softlights-fonts','http://fonts.googleapis.com/css?family=PT+Sans|Oswald|Roboto+Condensed'); wp_enqueue_style( 'default', get_stylesheet_uri() ); // default stylesheet wp_enqueue_style( 'softlights-fonts'); } add_action ('wp_enqueue_scripts','softlights_scripts_styles'); /************************** Set Limit to No of Posts ***********************************/ function softlights_posts_on_homepage( $query ) { if ( $query->is_main_query() ) { $query->set( 'posts_per_page', 12 ); } } add_action( 'pre_get_posts', 'softlights_posts_on_homepage' ); /******************************** Register Navigation menus ***************************/ add_action( 'init', 'softlights_nav_menu' ); function softlights_nav_menu() { register_nav_menu( 'primary-menu', 'Primary Menu'); register_nav_menu( 'top-menu', 'Top Menu' ); register_nav_menu( 'footer-menu', 'Footer Menu' ); } /************************** Theme Pagination *************************************/ function softlights_pagination() { global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages ) ); } /************ Pagination for Next ******************************/ function softlights_wp_link_pages() { return wp_link_pages(array('before' => '','next_or_number'=>'number', 'previouspagelink' => '« Previous Page', 'nextpagelink'=>'Next Page »')); } /********************************* Theme Widgets Setup **********************************/ add_action( 'widgets_init', 'softlights_widgets_init' ); function softlights_widgets_init() { /* Right and Left Sidebars */ register_sidebar(array( 'name' => 'Right Hand Sidebar', 'id' => 'right-sidebar', 'description' => 'Widgets in this area will be shown on the right-hand side.', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Left Hand Sidebar', 'id' => 'left-sidebar', 'description' => 'Widgets in this area will be shown on the right-hand side.', 'before_title' => '

', 'after_title' => '

' )); /* Top Widget */ register_sidebar(array( 'name' => 'Top Widget', 'id' => 'top-widget', 'description' => 'Appears below navigation below.', 'before_title' => '

', 'after_title' => '

' )); /* Footer widgets */ register_sidebar( array( 'name' => 'Footer Widget', 'id' => 'footer-widget', 'description' => 'Appears above footer. Max 5 boxes of equal size', 'before_title' => '

', 'after_title' => '

', ) ); /* Home page widgets */ register_sidebar( array( 'name' => 'Home Widget', 'id' => 'homepage-widget', 'description' => 'Appears at the center of homepage above boxed posts', 'before_title' => '

', 'after_title' => '

', ) ); } /******************************** Filter the Title *******************************/ function softlights_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) return $title; // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( 'Page %s', max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'softlights_wp_title', 10, 2 ); /********************************* Theme Admin section *******************************************/ if (is_admin()) { add_action ('admin_menu', 'softlights_admin_menu'); } function softlights_admin_menu() { add_theme_page( 'Theme Option','Softlights Options', 'edit_theme_options', 'sl-theme-options', 'softlights_options_page'); add_action( 'admin_init','softlights_register_mysettings' ); } function softlights_register_mysettings() { // whitelist options register_setting( 'softlights-option-group', 'softlights-options' ,'softlights_options_validate'); } /************************ Validation of admin input data ***********************/ function softlights_options_validate ($input) { $input['logo'] = esc_url_raw($input['logo']); $input['favicon'] = esc_url_raw($input['favicon']); $input['showcase-image'] = esc_url_raw($input['showcase-image']); $input['showcase-title'] = sanitize_text_field($input['showcase-title']); $input['showcase-text'] = sanitize_text_field($input['showcase-text']); $input['showcase-link'] = esc_url_raw($input['showcase-link']); $input['link-color'] = sanitize_text_field($input['link-color']); $input['content-link-color'] = sanitize_text_field($input['content-link-color']); $input['bg-color'] = sanitize_text_field($input['bg-color']); $input['menu-color'] = sanitize_text_field($input['menu-color']); $input['menu-font-color'] = sanitize_text_field($input['menu-font-color']); $input['header-color'] = sanitize_text_field($input['header-color']); $input['footer-color'] = sanitize_text_field($input['footer-color']); $input['widgets-menus-color'] = sanitize_text_field($input['widgets-menus-color']); $input['showcase-color'] = sanitize_text_field($input['showcase-color']); return $input; } /****************************** Theme Options Page *********************************/ function softlights_options_page() { ?>
Theme settings have been reset and default values loaded

'; } $softlights_options = get_option('softlights-options'); ?>

Please upload the logo and favicon to media library and paste the URL below.

Logo
(200x90px - only transparent PNG)
Favicon

Footer Copyright Text
(optional)

Comment Settings

You can chose to completely disable comments and comment form in this theme. If you receive spam and hate comments, disable it. Enabled by default.

> Enable/Disable Comments in Posts/Pages

Showcase Box Settings

> Enable/Disable Showcasebox Box

Showcase Image (optional):
(works any size- try big sizes like 300x300)

Showcase Title (optional):


Showcase Text (optional)


Link URL (optional):


Showcasebox Background Color

Makes changes to background color to showcasebox.

Showcasebox Font Color

Makes changes to font color to showcasebox.

Theme Color Settings

Dont be afraid to type 'transparent' in the below color values, if you prefer transparency

Theme Background Body Color

Sets the background of the entire site.

Navigation Menu Background Color:

Changes the background of navigation menu (primary menu)

Navigation Menu - Font Color

This changes only the font color to align with above nav background color

Header Background Color

Changes the background of the header:

Footer Background Color

Changes the background color of the footer:

All Widgets Background Color

Makes changes to background color of all widgets.

Note: Type transparent for transparency instead of a fixed color. To reset to default color values, simple delete all the color values and hit submit.

Please set the link colors to your theme

1. All Sitewide Links

Makes changes to links to entire site

2. Single Post/Page Link color

This is specific link color, occurs only inside page or post content.

Reset Defaults

Load theme default settings: