' : ''; echo '

'.($icon ? $icon : get_bloginfo('name')).'

'; $menu = wp_nav_menu( array( 'theme_location' => 'nav-menu', 'menu' => 'main-menu', 'container' => 'div', 'container_class' => 'menu-{menu slug}-container', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => 777, 'echo' => FALSE, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '', 'depth' => 0, 'walker' => '', ) ); $menu_name = 'nav-menu'; $locations = get_nav_menu_locations(); $menu_id = $locations[$menu_name] ; $menu_object = wp_get_nav_menu_object($menu_id); if ($menu_object !== FALSE) { echo '

'.$menu_object->name.'

'; } else { echo '

'.__( 'Menu', 'the90sretro' ).'

'; } echo $menu; echo ''; } function the90sretro_header_scripts() { if ( $GLOBALS['pagenow'] != 'wp-login.php' && ! is_admin() ) { if ( THE90SRETRO_DEBUG ) { wp_enqueue_script( 'jquery' ); wp_register_script('mpopup', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', array('jquery')); wp_enqueue_script('mpopup'); // Custom scripts wp_register_script( 'the90sretroscripts', get_template_directory_uri() . '/js/scripts.js', array( 'conditionizr', 'modernizr', 'jquery' ), '1.0.0' ); // Enqueue Scripts wp_enqueue_script( 'the90sretroscripts' ); // If production } else { // Scripts minify wp_register_script( 'the90sretroscripts-min', get_template_directory_uri() . '/js/scripts.min.js', array(), '1.0.0' ); // Enqueue Scripts wp_enqueue_script( 'the90sretroscripts-min' ); } } } function the90sretro_conditional_scripts() { if ( is_page( 'pagenamehere' ) ) { // Conditional script(s) wp_register_script( 'scriptname', get_template_directory_uri() . '/js/scriptname.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'scriptname' ); } } function the90sretro_styles() { if ( THE90SRETRO_DEBUG ) { // normalize-css wp_register_style( 'normalize', get_template_directory_uri() . '/css/lib/normalize.css', array(), '7.0.0' ); // Custom CSS wp_register_style( 'the90sretro', get_template_directory_uri() . '/style.css', array( 'normalize' ), '1.0' ); wp_register_style( 'mpopup', get_template_directory_uri() . '/css/magnific-popup.css', array()); // Register CSS wp_enqueue_style( 'the90sretro' ); wp_enqueue_style( 'mpopup' ); } else { // Custom CSS wp_register_style( 'the90sretrocssmin', get_template_directory_uri() . '/style.css', array(), '1.0' ); // Register CSS wp_enqueue_style( 'the90sretrocssmin' ); } } function register_the90sretro_menu() { register_nav_menus( array( // Using array to specify more menus if needed 'nav-menu' => esc_html( 'Main Menu', 'the90sretro' )//, // Main Navigation //'extra-menu' => esc_html( 'Extra Menu', 'the90sretro' ) // Extra Navigation if needed (duplicate as many as you need!) ) ); } // Remove the
surrounding the dynamic navigation to cleanup markup function my_wp_nav_menu_args( $args = '' ) { $args['container'] = false; return $args; } // Remove Injected classes, ID's and Page ID's from Navigation
  • items function my_css_attributes_filter( $var ) { return is_array( $var ) ? array() : ''; } // Remove invalid rel attribute values in the categorylist function remove_category_rel_from_category_list( $thelist ) { return str_replace( 'rel="category tag"', 'rel="tag"', $thelist ); } // Add page slug to body class, love this - Credit: Starkers Wordpress Theme function add_slug_to_body_class( $classes ) { global $post; if ( is_home() ) { $key = array_search( 'blog', $classes, true ); if ( $key > -1 ) { unset( $classes[$key] ); } } elseif ( is_page() ) { $classes[] = sanitize_html_class( $post->post_name ); } elseif ( is_singular() ) { $classes[] = sanitize_html_class( $post->post_name ); } return $classes; } // Remove the width and height attributes from inserted images function the90sretro_remove_width_attribute( $html ) { $html = preg_replace( '/(width|height)="\d*"\s/', "", $html ); return $html; } // If Dynamic Sidebar Exists if ( function_exists( 'register_sidebar' ) ) { // Define Sidebar Widget Area 1 register_sidebar( array( 'name' => esc_html( 'Under the Menu Widget Area', 'the90sretro' ), 'description' => esc_html( 'Put widgets you want to see under the navigation here.', 'the90sretro' ), 'id' => 'widget-area-1', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); // Define Sidebar Widget Area 2 register_sidebar( array( 'name' => esc_html( 'Right Side Widget Area', 'the90sretro' ), 'description' => esc_html( 'These widgets will be shown on the right side of the page.', 'the90sretro' ), 'id' => 'widget-area-2', 'before_widget' => '
    ', 'after_widget' => '
    ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } // Remove wp_head() injected Recent Comment styles function my_remove_recent_comments_style() { global $wp_widget_factory; if ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) { remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); } } // Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin function the90sretro_pagination() { global $wp_query; $big = 999999999; echo paginate_links( array( 'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, ) ); } // Create 20 Word Callback for Index page Excerpts, call using the90sretro_excerpt('the90sretro_index'); function the90sretro_index( $length ) { return 50; } // Create 40 Word Callback for Custom Post Excerpts, call using the90sretro_excerpt('the90sretro_custom_post'); function the90sretro_custom_post( $length ) { return 40; } // Create the Custom Excerpts callback function the90sretro_excerpt( $length_callback = '', $more_callback = '' ) { global $post; if ( function_exists( $length_callback ) ) { add_filter( 'excerpt_length', $length_callback ); } if ( function_exists( $more_callback ) ) { add_filter( 'excerpt_more', $more_callback ); } $output = get_the_excerpt(); $output = apply_filters( 'wptexturize', $output ); $output = apply_filters( 'convert_chars', $output ); $output = '

    ' . $output . '

    '; echo $output; } // Custom View Article link to Post function the90sretro_blank_view_article( $more ) { global $post; return '... ' . esc_html__( 'Read More', 'the90sretro' ) . ''; } // Remove 'text/css' from our enqueued stylesheet function the90sretro_style_remove( $tag ) { return preg_replace( '~\s+type=["\'][^"\']++["\']~', '', $tag ); } // Remove thumbnail width and height dimensions that prevent fluid images in the_thumbnail function remove_thumbnail_dimensions( $html ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', '', $html ); return $html; } // Custom Gravatar in Settings > Discussion function the90sretrogravatar ( $avatar_defaults ) { $myavatar = get_template_directory_uri() . '/img/gravatar.jpg'; $avatar_defaults[$myavatar] = 'Custom Gravatar'; return $avatar_defaults; } // Threaded Comments function enable_threaded_comments() { if ( ! is_admin() ) { if ( is_singular() AND comments_open() AND ( get_option( 'thread_comments' ) == 1 ) ) { wp_enqueue_script( 'comment-reply' ); } } } // Custom Comments Callback function the90sretrocomments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; extract( $args, EXTR_SKIP ); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    %s says:' , get_comment_author_link() ) ?>
    comment_approved == '0' ) : ?>
    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ) ?>
    Discussion add_filter( 'body_class', 'add_slug_to_body_class' ); // Add slug to body class (Starkers build) add_filter( 'widget_text', 'do_shortcode' ); // Allow shortcodes in Dynamic Sidebar add_filter( 'widget_text', 'shortcode_unautop' ); // Remove

    tags in Dynamic Sidebars (better!) add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' ); // Remove surrounding

    from WP Navigation add_filter( 'the_category', 'remove_category_rel_from_category_list' ); // Remove invalid rel attribute add_filter( 'the_excerpt', 'shortcode_unautop' ); // Remove auto

    tags in Excerpt (Manual Excerpts only) add_filter( 'the_excerpt', 'do_shortcode' ); // Allows Shortcodes to be executed in Excerpt (Manual Excerpts only) add_filter( 'excerpt_more', 'the90sretro_blank_view_article' ); // Add 'View Article' button instead of [...] for Excerpts add_filter( 'style_loader_tag', 'the90sretro_style_remove' ); // Remove 'text/css' from enqueued stylesheet add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); // Remove width and height dynamic attributes to thumbnails add_filter( 'post_thumbnail_html', 'the90sretro_remove_width_attribute', 10 ); // Remove width and height dynamic attributes to post images add_filter( 'image_send_to_editor', 'the90sretro_remove_width_attribute', 10 ); // Remove width and height dynamic attributes to post images add_filter( 'wp_title', 'the90sretro_get_the_title'); // Remove Filters remove_filter( 'the_excerpt', 'wpautop' ); // Remove

    tags from Excerpt altogether /*------------------------------------*\ ShortCode Functions \*------------------------------------*/ // Shortcode Demo with Nested Capability function the90sretro_shortcode_demo( $atts, $content = null ) { return '

    ' . do_shortcode( $content ) . '
    '; // do_shortcode allows for nested Shortcodes } // Demo Heading H2 shortcode, allows for nesting within above element. Fully expandable. function the90sretro_shortcode_demo_2( $atts, $content = null ) { return '

    ' . $content . '

    '; } function the90sretro_load_admin_style() { wp_register_style('retro_admin_css', get_template_directory_uri() . '/admin-style.css', false, '1.0.0'); wp_enqueue_style('retro_admin_css'); wp_enqueue_script('retro_demo_admin', get_template_directory_uri() . '/js/admin.js'); } function the90sretro_get_gif1_url() { $gif_url = get_option('the90sretro_gif1_alt_location'); if (empty($gif_url)) { $gif_url = esc_url(get_template_directory_uri()) . '/img/gifs/globe.gif'; } return $gif_url; } function the90sretro_print_gif1_if_enabled() { if (get_option('the90sretro_display_gifs') == 1) { echo ''.__('Content Starts', 'the90sretro').''; } } function the90sretro_print_gif2_if_enabled() { if (get_option('the90sretro_display_gifs') == 1) { echo ''.__('Site under construction', 'the90sretro').''; } } function the90sretro_print_gif3_if_enabled() { if (get_option('the90sretro_display_gifs') == 1) { echo ''.__('Page not found', 'the90sretro').''; } } function the90sretro_return_gif1_if_enabled() { if (get_option('the90sretro_display_gifs') == 1) { return ''.__('Content Starts', 'the90sretro').''; } return NULL; } function the90sretro_return_gif2_if_enabled() { if (get_option('the90sretro_display_gifs') == 1) { return ''.__('Site under construction', 'the90sretro').''; } return NULL; } function the90sretro_prefix_remove_css_section( $wp_customize ) { $wp_customize->remove_section( 'custom_css' ); } function the90sretro_get_the_title($title) { if (is_front_page()) { return get_bloginfo('name'); } global $post; return $post->post_title; }