' . __( 'Continue Reading→', 'broadwell' ) . ''; } /** * Dynamic CSS */ add_action( 'wp_enqueue_scripts', 'broadwell_dynamic_css' ); function broadwell_dynamic_css() { if ( !is_admin() ) { $primary_color = get_theme_mod( 'setting_primary_color', '#ff6633' ); $secondary_color = get_theme_mod( 'setting_secondary_color' , '#204a5d' ); if ( get_theme_mod( 'setting_image_area1' ) ? $area1_pic = get_theme_mod( 'setting_image_area1' ) : $area1_pic = C_ROOT.'/images/decks.jpg' ); if ( get_theme_mod( 'setting_image_area2' ) ? $area2_pic = get_theme_mod( 'setting_image_area2' ) : $area2_pic = C_ROOT.'/images/placeholder.png' ); if ( get_theme_mod( 'setting_image_area3' ) ? $area3_pic = get_theme_mod( 'setting_image_area3' ) : $area3_pic = C_ROOT.'/images/placeholder.png' ); if ( get_theme_mod( 'setting_image_area4' ) ? $area4_pic = get_theme_mod( 'setting_image_area4' ) : $area4_pic = C_ROOT.'/images/placeholder.png' ); if ( get_theme_mod( 'setting_image_area5' ) ? $area5_pic = get_theme_mod( 'setting_image_area5' ) : $area5_pic = C_ROOT.'/images/placeholder.png' ); $dynamic_css = ' /*-------------------'.strtoupper(C_NAME).' DYNAMIC CSS---------------------*/ #primary-menu li > a:hover{ color: '.$primary_color.' } .home #primary-menu li > a.active { background-color: '.$secondary_color.'; color:#eee} .comments-title i { color: '.$primary_color.' } .comment-reply-link {background-color: '.$primary_color.'; color: #fff !important} .entry-title, .entry-title a{color: '.$secondary_color.' } .entry-title a:hover {color: '.$primary_color.' } #area1 {background: url("'.$area1_pic.'") no-repeat center center fixed; background-size:cover; } #area2 {background: url("'.$area2_pic.'") no-repeat center center fixed; background-size:cover; } #area3 {background: url("'.$area3_pic.'") no-repeat center center fixed; background-size:cover; } #area4 {background: url("'.$area4_pic.'") no-repeat center center fixed; background-size:cover; } #area5 {background: url("'.$area5_pic.'") no-repeat center center fixed; background-size:cover; } .mobile.lt-1280 #area1 {background: url("'.$area1_pic.'") no-repeat center center; background-size:cover; } .mobile.lt-1280 #area2 {background: url("'.$area2_pic.'") no-repeat center center; background-size:cover; } .mobile.lt-1280 #area3 {background: url("'.$area3_pic.'") no-repeat center center; background-size:cover; } .mobile.lt-1280 #area4 {background: url("'.$area4_pic.'") no-repeat center center; background-size:cover; } .mobile.lt-1280 #area5 {background: url("'.$area5_pic.'") no-repeat center center; background-size:cover; } .nav-next, .nav-previous { background-color: '.$secondary_color.' } #searchform .input-group-addon {background-color: '.$primary_color.' ; color:#fff} #secondary .widget-title { color: '.$secondary_color.' } .site-footer {background-color: '.$primary_color.' } /*-------------------'.strtoupper(C_NAME).' DYNAMIC CSS---------------------*/ '; wp_add_inline_style( 'broadwell-dynamic', $dynamic_css ); } } /** * User CSS */ add_action( 'wp_enqueue_scripts', 'broadwell_user_css' ); function broadwell_user_css() { if ( !is_admin() ) { $css = get_theme_mod( 'setting_custom_css' ); if ( !empty ($css) ) { $user_css = ' /*-------------------'.strtoupper(C_NAME).' USER CSS---------------------*/ '.$css.' /*-------------------'.strtoupper(C_NAME).' USER CSS---------------------*/ '; wp_add_inline_style( 'broadwell-dynamic', $user_css ); } } } /** * Configuration on Activation */ function broadwell_activate() { If ( is_admin() ) { /* Trigger one-time setup tasks. */ if ( !get_option( 'broadwell_status' ) ) { /* Set a temporary activation flag */ update_option( 'broadwell_status', 'First Run' ); /* Set customizer default settings */ broadwell_initialize_settings(); /* Set specific page for Blog */ $blog_home = C_NAME.' - Blog Home'; if( !get_page_by_title( $blog_home ) ) { wp_insert_post( array( 'post_name' => 'blog', 'post_title' => $blog_home, 'post_status' => 'publish', 'post_type' => 'page', 'post_content' => 'Do not delete this page while '.C_NAME.' is the active theme.', ) ); } $blog = get_page_by_title( $blog_home ); update_option( 'page_for_posts', $blog->ID ); } /* Unset activation flag after one-time tasks are done */ if ( 'Installed Before' !==get_option( 'broadwell_status' ) ) { update_option( 'broadwell_status', 'Installed Before' ); } /* Set customizer settings to default values if they don't already exist from a prior install */ if ( !get_option( 'theme_mods_broadwell' ) ) { broadwell_initialize_settings(); } } }