'', 'default-image' => '', 'default-repeat' => '', 'default-position-x' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $softlights_bg_defaults ); /************** Setup Custom Header to upload Logo *****************/ $softlights_header_defaults = array( 'default-image' => '', 'default-color' => '#fff', 'random-default' => false, 'width' => 1600, 'height' => 130, 'flex-height' => true, 'flex-width' => true, 'default-text-color' => '', 'header-text' => false, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $softlights_header_defaults ); if ( ! isset( $content_width ) ) $content_width = 672; $softlights_settings = get_option('softlights-options'); if($softlights_settings === false) { $softlights_settings = softlights_defaults(); } update_option('softlights-options', $softlights_settings); } /****************** Initialize Theme Default Values **************************************/ function softlights_defaults() { $defaults = array ( 'logo' => '', 'favicon' => '', 'footer' => '', 'showcase-image' => '', 'showcase-title' => '', 'showcase-text' => '', 'showcase-link' => '', 'menu-color' => '#caeffc', 'header-color' => 'transparent', 'menu-font-color' => '#333', 'widgets-menus-color' => '', 'footer-color' => '#b7d3e5', 'link-color' => '#000', 'content-link-color' => '#cc0000', 'showcase-color' => '#f5fefe', 'showcase-font-color' => '#777', 'showcase' => '0', 'comments' => '1', 'reset' => '0' ); return $defaults; } /********************** Adjust content width for full page templates *******************************/ function softlights_content_width() { global $content_width; if(is_page_template( 'full-width.php' ) ) $content_width = 1150; } add_action( 'template_redirect', 'softlights_content_width' ); /********************************* 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( 'appearance_page_softlights-theme-options', 'softlights_admin_scripts' ); function softlights_admin_scripts($hook) { wp_enqueue_script('jquery'); wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'sl-script-handle', get_template_directory_uri().'/js/myscript.js', array( 'wp-color-picker','jquery' ), false, true ); 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','//fonts.googleapis.com/css?family=PT+Sans|Oswald|Roboto+Condensed'); wp_enqueue_style( 'softlights-css', get_stylesheet_uri() ); // default stylesheet wp_enqueue_style( 'softlights-fonts'); } add_action ('wp_enqueue_scripts','softlights_scripts_styles'); /******************************** 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' => '