. ** **************************************************************************** ** functions.php (Shared functions) ** ** ** ** This source file contains various functions that are referenced by ** ** other source files. ** **************************************************************************** */ ?> '#232323', ); add_theme_support('custom-background', $retrogeek_args); // add support for feed links. add_theme_support('automatic-feed-links'); // add support for post thumbnails. add_theme_support('post-thumbnails'); // add support for custom-header. $retrogeek_args1 = array( 'default-text-color' => '#00ff00', 'width' => 900, 'height' => 150, 'flex-width' => true, 'flex-height' => true, ); add_theme_support('custom-header', $retrogeek_args1); $retrogeek_args2 = array( 'width' => 170, 'height' => 150, 'flex-width' => true, 'flex-height' => true, 'header-text' => array('site-title', 'site-description'), 'unlink-homepage-logo' => true, ); add_theme_support('custom-logo', $retrogeek_args2); } add_action('after_setup_theme', 'retrogeek_theme_support'); /** * Sets up theme defaults and registers support for various WordPress features. */ function retrogeek_editor_styles_setup() { $m1 = esc_attr(get_theme_mod('textcolor', '#00ff00')); $m2 = esc_attr(get_theme_mod('link_textcolor', '#74f774')); $m3 = esc_attr(get_theme_mod('background_color', '#232323')); add_theme_support( 'editor-color-palette', array( array( 'name' => 'retrogeek background color', 'slug' => 'retrogeek-background', 'color' => $m3, ), array( 'name' => 'retrogeek foreground color', 'slug' => 'retrogeek-foreground', 'color' => $m1, ), array( 'name' => 'retrogeek link color', 'slug' => 'retrogeek-link', 'color' => $m2, ), ) ); // Add support for editor styles. add_theme_support('editor-styles'); // Enqueue editor styles. add_editor_style('assets/css/editor-styles.css'); } add_action('after_setup_theme', 'retrogeek_editor_styles_setup'); /** * This functions echos the CSS vars used from customizer for the WordPress editor. **/ function retrogeek_css_admin_vars() { $css_str = RetroGeek_Customize::header_output(); echo ''; } add_action('admin_head', 'retrogeek_css_admin_vars'); /** * Enqueue style sheets. */ function retrogeek_add_theme_scripts() { wp_enqueue_script('retrogeek-javascript', get_template_directory_uri() . '/assets/js/retrogeek_func.js', false, 42, true); wp_enqueue_style('retrogeek-normalize', get_template_directory_uri() . '/assets/css/normalize.css', false, '42', 'all'); wp_enqueue_style('retrogeek-skeleton', get_template_directory_uri() . '/assets/css/skeleton.css', 'retrogeek-normalize', '42', 'all'); wp_enqueue_style('retrogeek-style', get_template_directory_uri() . '/style.css', 'retrogeek-skeleton', '42', 'all'); // Output custom CSS to site. $css_str = RetroGeek_Customize::header_output(); wp_add_inline_style('retrogeek-skeleton', $css_str, 'after'); if(is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'retrogeek_add_theme_scripts'); /** * Remove invalid html from WordPress. * * @param string $content HTML string to sanitize. */ function retrogeek_sanitize_pagination($content) { // Remove role attribute. $content = str_replace('role="navigation"', '', $content); // Remove h2 tag. $content = preg_replace('#