芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/_syntaxis.fr/wp-content/themes/chimera/functions.php
'Chimera Shortcodes', // The plugin name 'slug' => 'chimera-shortcodes', // The plugin slug (typically the folder name) 'source' => get_template_directory_uri() . '/plugins/chimera-shortcodes.zip', // The plugin source 'required' => false, // If false, the plugin is only 'recommended' instead of required 'version' => '1.0', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented 'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch 'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins 'external_url' => '', // If set, overrides default API URL and points to an external URL ), /** * WordPress.org Plugins */ array( 'name' => 'Breadcrumb Trail', 'slug' => 'breadcrumb-trail', 'required' => false, ), /* array( 'name' => 'Custom Content Portfolio', 'slug' => 'custom-content-portfolio', 'required' => false, ), //*/ array( 'name' => 'Our Team', 'slug' => 'our-team-by-woothemes', 'required' => false, ), array( 'name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false, ) ); /** * Theme's Text Domain -- Changing this due to Theme Check errors... */ //$theme_text_domain = 'chimera'; /** * Array of configuration settings. Amend each line as needed. * If you want the default strings to be available under your own theme domain, * leave the strings uncommented. * Some of the strings are added into a sprintf, so see the comments at the * end of each line for what each argument will be. */ $config = array( 'domain' => 'chimera', // Text domain - likely want to be the same as your theme. 'default_path' => '', // Default absolute path to pre-packaged plugins 'parent_menu_slug' => 'themes.php', // Default parent menu slug 'parent_url_slug' => 'themes.php', // Default parent URL slug 'menu' => 'install-required-plugins', // Menu slug 'has_notices' => true, // Show admin notices or not 'is_automatic' => false, // Automatically activate plugins after installation or not 'message' => '', // Message to output right before the plugins table 'strings' => array( 'page_title' => __( 'Install Required Plugins', 'chimera' ), 'menu_title' => __( 'Install Plugins', 'chimera' ), 'installing' => __( 'Installing Plugin: %s', 'chimera' ), // %1$s = plugin name 'oops' => __( 'Something went wrong with the plugin API.', 'chimera' ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s) 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s) 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s) 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s) 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s) 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s) 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s) 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s) 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ), 'return' => __( 'Return to Required Plugins Installer', 'chimera' ), 'plugin_activated' => __( 'Plugin activated successfully.', 'chimera' ), 'complete' => __( 'All plugins installed and activated successfully. %s', 'chimera' ), // %1$s = dashboard link 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated' or 'error' ) ); tgmpa( $plugins , $config ); } /** * Include the theme options (SMOF) * ========================================================================================================================================= * @since 1.0 */ require_once( 'admin/index.php' ); /** * Set the content width * ========================================================================================================================================= * @since 1.0 */ if ( ! isset( $content_width ) ) { $content_width = 1200; // In pixels } if( ! function_exists( 'chimera_setup' ) ) : /** * Setup the theme * ========================================================================================================================================= * @since 1.0 */ function chimera_setup() { /** * Make Chimera available for translation */ load_theme_textdomain( 'chimera' , get_template_directory() . '/lang' ); /** * Add the editor style */ add_editor_style(); /** * Add support for feed links */ add_theme_support( 'automatic-feed-links' ); /** * Add support for post thumbnails */ add_theme_support( 'post-thumbnails' ); /** * Add support for HTML5 markup for forms */ add_theme_support( 'html5' , array( 'search-form' , 'comment-form' , 'comment-list' ) ); /** * Add support for custom backgrounds */ add_theme_support( 'custom-background' , apply_filters( 'chimera_custom_background_args' , array( 'default-color' => 'ffffff' ) ) ); /** * Add support for different post formats */ add_theme_support( 'post-formats' , array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery' ) ); /** * Register the menus for use in the theme */ register_nav_menus( array( 'primary' => __( 'Page Header Navigation' , 'chimera' ) ) ); } endif; add_action( 'after_setup_theme' , 'chimera_setup' ); /** * Enqueue all scripts and styles for the front end * ========================================================================================================================================= * @since 1.0 */ function chimera_scripts() { /** * Add the "Alegreya Sans" and "PT Sans" fonts from Google's font library * These can be overidden in the Theme Options */ wp_enqueue_style( 'chimera-google-fonts' , chimera_font_url() , array() , null ); /** * Unsemantic Grid * ------------------------------------------------------------------------------------------------------------------------------------- * https://github.com/nathansmith/unsemantic */ wp_enqueue_style( 'chimera-unsemantic-grid' , get_template_directory_uri() . '/css/unsemantic-grid.css' , array() , '1.0' , 'all' ); /** * Formalize * ------------------------------------------------------------------------------------------------------------------------------------- * http://formalize.me/ */ wp_enqueue_style( 'chimera-formalize' , get_template_directory_uri() . '/css/formalize.css' , array() , '1.2' , 'all' ); /** * Font Awesome Glyph Icons * ------------------------------------------------------------------------------------------------------------------------------------- * http://fontawesome.io/ */ wp_enqueue_style( 'chimera-font-awesome' , get_template_directory_uri() . '/css/font-awesome.min.css' , array() , '4.0.3' , 'all' ); /** * Slimbox 2 CSS * ------------------------------------------------------------------------------------------------------------------------------------- * http://www.digitalia.be/software/slimbox2 */ wp_enqueue_style( 'chimera-slimbox' , get_template_directory_uri() . '/css/slimbox2.css' , array() , '2.05' , 'screen' ); if( is_page_template( 'page-templates/template-home.php' ) ) { /** * Fraction Slider Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://jacksbox.de/stuff/jquery-fractionslider/ */ wp_enqueue_style( 'chimera-fraction-slider' , get_template_directory_uri() . '/css/fractionslider.css' , array() , '0.9.103' , 'all' ); } /** * Main Stylesheet */ wp_enqueue_style( 'chimera' , get_stylesheet_uri() ); /** * Responsive CSS */ wp_enqueue_style( 'chimera-responsive' , get_template_directory_uri() . '/css/responsive.css' , array() , '1.0.0' , 'all' ); /** * IE Styles */ wp_enqueue_style( 'chimera-ie' , get_template_directory_uri() . '/css/ie.css' , array() , '1.0.0' ); wp_style_add_data( 'chimera-ie' , 'conditional' , 'lt IE 9' ); /** * jQuery Easing Plugin * ------------------------------------------------------------------------------------------------------------------------------------- * http://www.gsgd.co.uk/sandbox/jquery/easing/ */ wp_enqueue_script( 'chimera-easing' , get_template_directory_uri() . '/js/jquery.easing.1.3.js' , array( 'jquery' ) , '1.3' , true ); /** * Superfish Dropdown Menu jQuery Script * ------------------------------------------------------------------------------------------------------------------------------------- * https://github.com/joeldbirch/superfish */ wp_enqueue_script( 'chimera-superfish' , get_template_directory_uri() . '/js/jquery.superfish.min.js' , array( 'jquery' ) , '1.7.4' , true ); /** * FitVids Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://fitvidsjs.com/ */ wp_enqueue_script( 'chimera-fitvids' , get_template_directory_uri() . '/js/jquery.fitvids.js' , array( 'jquery' ) , '1.0.3' , true ); /** * Slimbox 2 Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://www.digitalia.be/software/slimbox2 */ wp_enqueue_script( 'chimera-slimbox' , get_template_directory_uri() . '/js/jquery.slimbox.js' , array( 'jquery' ) , '2.05' , true ); /** * Formalize Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://formalize.me/ */ wp_enqueue_script( 'chimera-formalize' , get_template_directory_uri() . '/js/jquery.formalize.js' , array( 'jquery' ) , '1.2' , true ); /** * Tooltip Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://vadikom.com/demos/poshytip/ */ wp_enqueue_script( 'chimera-poshytip' , get_template_directory_uri() . '/js/jquery.poshytip.min.js' , array( 'jquery' ) , '1.2' , true ); /** * Responsive Navigation Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://tinynav.viljamis.com/ */ wp_enqueue_script( 'chimera-tinynav' , get_template_directory_uri() . '/js/jquery.tinynav.min.js' , array( 'jquery' ) , '1.1' , true ); if( is_page_template( 'page-templates/template-home.php' ) ) { /** * Fraction Slider Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://jacksbox.de/stuff/jquery-fractionslider/ */ wp_enqueue_script( 'chimera-fraction-slider' , get_template_directory_uri() . '/js/jquery.fractionslider.min.js' , array( 'jquery' ) , '0.9.103' , true ); } // if( is_page_template( 'page-templates/template-portfolio-five-columns.php' ) || is_page_template( 'page-templates/template-portfolio-four-columns.php' ) || is_page_template( 'page-templates/template-portfolio-three-columns.php' ) ) { /** * Mixitup Script * ------------------------------------------------------------------------------------------------------------------------------------- * http://mixitup.io/ */ // wp_enqueue_script( 'chimera-mixitup' , get_template_directory_uri() . '/js/jquery.mixitup.min.js' , array( 'jquery' ) , '1.5.5' , true ); // } /** * Comment Reply Script */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } /** * Custom Scripts */ wp_enqueue_script( 'chimera-custom' , get_template_directory_uri() . '/js/jquery.custom.js' , array( 'jquery' ) , '1.0' , true ); } add_action( 'wp_enqueue_scripts' , 'chimera_scripts' ); /** * Setup all the theme's widget areas * ========================================================================================================================================= * @since 1.0 */ function chimera_widgets_init() { require get_template_directory() . '/inc/widgets.php'; register_widget( 'Chimera_Contact_Widget' ); register_widget( 'Chimera_Flickr_Widget' ); register_widget( 'Chimera_Recent_Posts_Widget' ); register_sidebar( array( 'name' => __( 'Main Sidebar' , 'chimera' ), 'id' => 'main-sidebar', 'description' => __( 'This is the main sidebar that appears on blog pages.' , 'chimera' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Sidebar - Column 01' , 'chimera' ), 'id' => 'footer-sidebar-01', 'description' => __( 'This Sidebar will appear inside the footer\'s first column.' , 'chimera' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Sidebar - Column 02' , 'chimera' ), 'id' => 'footer-sidebar-02', 'description' => __( 'This Sidebar will appear inside the footer\'s second column.' , 'chimera' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Sidebar - Column 03' , 'chimera' ), 'id' => 'footer-sidebar-03', 'description' => __( 'This Sidebar will appear inside the footer\'s third column.' , 'chimera' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Sidebar - Column 04' , 'chimera' ), 'id' => 'footer-sidebar-04', 'description' => __( 'This Sidebar will appear inside the footer\'s fourth column.' , 'chimera' ), 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action( 'widgets_init' , 'chimera_widgets_init' ); /** * Load the fonts from the Google Font Library stored in the Theme Options * ========================================================================================================================================= * @since 1.0 */ function chimera_font_url() { global $smof_data; $primary_font = empty( $smof_data['chimera_primary_font'] ) ? 'PT Sans' : $smof_data['chimera_primary_font']; $secondary_font = empty( $smof_data['chimera_secondary_font'] ) ? 'Alegreya Sans' : $smof_data['chimera_secondary_font']; //$primary_font = isset( $smof_data['chimera_primary_font'] ) ? $smof_data['chimera_primary_font'] : 'PT Sans'; //$secondary_font = isset( $smof_data['chimera_secondary_font'] ) ? $smof_data['chimera_secondary_font'] : 'Alegreya Sans'; $font_url = ''; $font_url = add_query_arg( 'family' , urlencode( $primary_font . ':400,400italic,700|' . $secondary_font . ':400,300' ) , "//fonts.googleapis.com/css" ); return $font_url; } /** * Adds a list item to the WordPress dropdown menu to access the Theme Options easier * ========================================================================================================================================= * @since 1.0 */ if ( ! is_admin() ) : add_action( 'admin_bar_menu' , 'chimera_options_node' , 999 ); function chimera_options_node( $wp_admin_bar ) { $args = array( 'id' => 'chimera-theme-options', 'title' => __( 'Theme Options' , 'chimera' ), 'href' => admin_url() . 'themes.php?page=optionsframework', 'parent' => 'site-name' ); $wp_admin_bar->add_node( $args ); } endif; if ( ! function_exists( 'chimera_paging_nav' ) ) : /** * Displays navigation links between posts where applicable (Modified from Twenty Fourteen Theme) * ========================================================================================================================================= * @since 1.0 */ function chimera_paging_nav() { // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?' , $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1] , $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ) , $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && ! strpos( $pagenum_link , 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%' , 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map( 'urlencode' , $query_args ), 'prev_text' => '
', 'next_text' => '
' ) ); if ( $links ) : ?>
post_parent ) : get_adjacent_post( false , '' , true ); $next = get_adjacent_post( false , '' , false ); if ( ! $next && ! $previous ) { return; } ?>
ID ) , 'full' ); $image_url = $image_atts[0]; $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; // Retrieve the image Caption $image_desc = get_post( get_post_thumbnail_id() )->post_content; // Retrieve the image Description ?>
ID ) , 'full' ); $image_url = $image_atts[0]; $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; // Retrieve the image Caption $image_desc = get_post( get_post_thumbnail_id() )->post_content; // Retrieve the image Description ?>
< id="comment-">
%s' , 'chimera' ), get_comment_author_link()) ?> comment_approved == '0' ) : ?>
$add_below , 'depth' => $depth , 'max_depth' => $args['max_depth'] ) ) ); ?>
= 2 || $page >= 2 ) { $title = "$title $sep " . sprintf( __( 'Page %s' , 'chimera' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title' , 'chimera_wp_title' , 10 , 2 ); /** * Generate all images from a slide for the Fraction Slider. * ========================================================================================================================================= * @since 1.0 */ function get_chimera_slides( $chimera_slide ) { global $smof_data; $elements = $smof_data["$chimera_slide"]; if( ! empty( $elements ) ) : // If there's no URL, dont't print empty markup. Let's bail... foreach( $elements as $el ) { if( $el['url'] == '' || $el == null ) { return; } } ?>
__( 'Twitter Profile URL' , 'chimera' ), 'description' => __( 'Enter URL to your Twitter Profile' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); $fields['chimera_twitter_tooltip'] = array( 'name' => __( 'Twitter Icon Tooltip Text' , 'chimera' ), 'description' => __( 'Enter the Tooltip text to be displayed when the user hoveres over the icon' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); $fields['chimera_facebook'] = array( 'name' => __( 'Facebook Profile URL' , 'chimera' ), 'description' => __( 'Enter URL to your Facebook Profile' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); $fields['chimera_facebook_tooltip'] = array( 'name' => __( 'Facebook Icon Tooltip Text' , 'chimera' ), 'description' => __( 'Enter the Tooltip text to be displayed when the user hoveres over the icon' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); $fields['chimera_email'] = array( 'name' => __( 'Email Address' , 'chimera' ), 'description' => __( 'Enter an Email Address' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); $fields['chimera_email_tooltip'] = array( 'name' => __( 'Email Icon Tooltip Text' , 'chimera' ), 'description' => __( 'Enter the Tooltip text to be displayed when the user hoveres over the icon' , 'chimera' ), 'type' => 'text', 'default' => '', 'section' => 'info' ); return $fields; } add_filter( 'woothemes_our_team_member_fields' , 'chimera_new_fields' ); endif; // End if is_plugin_active() /** * Apply all the Custom Styles from the Theme Options Data * ========================================================================================================================================= * * @since 1.0 */ function get_chimera_custom_styles() { /** * * Sanitize Theme Options Data * --------------------------------------------------------------------------- * */ global $smof_data; $color_regex = '/#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?\b/'; $chimera_page_header_logo_top = sanitize_text_field( $smof_data['chimera_page_header_logo_top'] ); $chimera_page_header_logo_left = sanitize_text_field( $smof_data['chimera_page_header_logo_left'] ); $chimera_primary_font = empty( $smof_data['chimera_primary_font'] ) ? 'PT Sans' : $smof_data['chimera_primary_font']; $chimera_secondary_font = empty( $smof_data['chimera_secondary_font'] ) ? 'Alegreya Sans' : $smof_data['chimera_secondary_font']; $temp = empty( $smof_data['chimera_page_header_background_color'] ) ? '#ffffff' : $smof_data['chimera_page_header_background_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_page_header_background_color = $temp; } else { $chimera_page_header_background_color = '#ffffff'; } $temp = empty( $smof_data['chimera_page_footer_background_color'] ) ? '#4d4d4d' : $smof_data['chimera_page_footer_background_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_page_footer_background_color = $temp; } else { $chimera_page_footer_background_color = '#4d4d4d'; } $temp = empty( $smof_data['chimera_page_footer_text_color'] ) ? '#a6a6a6' : $smof_data['chimera_page_footer_text_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_page_footer_text_color = $temp; } else { $chimera_page_footer_text_color = '#a6a6a6'; } $temp = empty( $smof_data['chimera_page_footer_heading_color'] ) ? '#ffffff' : $smof_data['chimera_page_footer_heading_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_page_footer_heading_color = $temp; } else { $chimera_page_footer_heading_color = '#ffffff'; } $temp = empty( $smof_data['chimera_page_footer_link_color'] ) ? '#ffffff' : $smof_data['chimera_page_footer_link_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_page_footer_link_color = $temp; } else { $chimera_page_footer_link_color = '#ffffff'; } $temp = empty( $smof_data['chimera_bottom_background_color'] ) ? '#404040' : $smof_data['chimera_bottom_background_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_bottom_background_color = $temp; } else { $chimera_bottom_background_color = '#404040'; } $temp = empty( $smof_data['chimera_bottom_text_color'] ) ? '#808080' : $smof_data['chimera_bottom_text_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_bottom_text_color = $temp; } else { $chimera_bottom_text_color = '#808080'; } $temp = empty( $smof_data['chimera_bottom_link_color'] ) ? '#ffffff' : $smof_data['chimera_bottom_link_color']; if( preg_match( $color_regex , $temp ) ) { $chimera_bottom_link_color = $temp; } else { $chimera_bottom_link_color = '#ffffff'; } /** * * Apply Theme Options Styles * --------------------------------------------------------------------------- * */ ?>