__( 'Primary Menu', 'molecular' ), 'small_menu' => __( 'Small Header Menu', 'molecular' ) )); add_theme_support( 'custom-background', array()); add_theme_support( 'post-thumbnails' ); // Featured Images add_theme_support( 'title-tag' ); // Allow plugins to manage the title tag - https://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag add_theme_support( 'custom-header' ); // Custom Header Image - https://codex.wordpress.org/Function_Reference/add_theme_support#Custom_Header add_theme_support( 'automatic-feed-links' ); // https://codex.wordpress.org/Function_Reference/add_theme_support#Feed_Links add_editor_style( RBK_THEME_DIR . '/css/editor_style.css' ); } add_action( 'after_setup_theme', 'molecular_theme_setup' ); /** * Register widget areas * @return WordPress widget functionality */ function molecular_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'molecular' ), 'id' => 'sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Mobile Menu Content Area', 'molecular' ), 'id' => 'mobile_menu_content', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widgets Area', 'molecular' ), 'id' => 'footer_widgets', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'molecular_widgets_init' ); /** * Enqueue scripts and stylesheets here to be compatible with WordPress plugins. * @return script and link tags */ function molecular_enqueue_scripts() { // DEV ONLY - Live Reload and Grunt Tasks $host = $_SERVER['HTTP_HOST']; if( $host == 'localhost' ){ wp_enqueue_script( 'livereload', 'http://localhost:123456/livereload.js', array(), '20130115', false ); } wp_enqueue_style( 'molecular-stylesheet', RBK_THEME_DIR . '/css/app.css', '', 1, 'all'); wp_enqueue_style( 'molecular-font-awesome', RBK_THEME_DIR . '/font-awesome-4.4.0/css/font-awesome.min.css', '', 4, 'all' ); wp_enqueue_script( 'molecular-production-js', RBK_THEME_DIR . '/js/build/production.min.js', array('jquery'), '20120206', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'molecular_enqueue_scripts' ); function get_featured_image_url( $post_id, $size = 'full'){ $image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), $size ); if( isset($image_url[0]) ){ return $image_url[0]; } else { return false; } } function new_excerpt_length($length) { return 40; } add_filter('excerpt_length', 'new_excerpt_length'); /** * Add link to content at the end of the excerpt, WordPress style. * @param string $more WordPress default [...] ([…]) * @return string What we want to replace the default more string with. */ function new_excerpt_more( $more ) { return '… ' . __( 'Read More', 'molecular' ) . ''; } add_filter( 'excerpt_more', 'new_excerpt_more' ); /** * Custom Password Protected Form */ function molecular_password_form() { global $post; $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); $o = '
'; $o .= __( "To view this protected post, enter the password below:", "molecular" ); $o .= ''; $o .= ' '; $o .= ''; $o .= '
'; return $o; } add_filter( 'the_password_form', 'molecular_password_form' ); /** * Imports */ include('includes/cool-php-functions.php'); include('theme_mods/main.php'); include('includes/template-tags.php'); include('includes/comments-template.php');