WordPress.org

Ready to get started?Download WordPress

Forums

Navigation Bar (3 posts)

  1. ukmark
    Member
    Posted 1 year ago #

    How do you place the login and logout box on your navigation bar? I tried earlier to insert some code in my functions theme but it went horribly wrong.
    Before i screw up again. I would like you to take a look at my functions theme in which i have copyed and pasted below:
    Thank You

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser. ]

    <?php
    
    load_theme_textdomain( 'nest', get_template_directory() . '/languages' );
    
    /* ========== Theme widgets ========== */
    
    include( get_stylesheet_directory() . '/includes/nest.widgets.php' );
    
    /* ========== Theme options ========== */
    
    include( get_stylesheet_directory() . '/includes/nest.options.php' );
    
    /* ========== Theme parts ========== */
    
    include( get_stylesheet_directory() . '/includes/nest.themeparts.php' );
    
    /* ========== Theme setup ========== */
    
    function nest_theme_setup() {
    	add_theme_support( 'post-thumbnails' );
    	add_theme_support( 'automatic-feed-links' );
    }
    add_action( 'after_setup_theme', 'nest_theme_setup' );
    
    function nest_widgets_init() {
    	register_sidebar( array(
    		'name' => __( 'Primary Widget Area', 'nest' ),
    		'id' => 'primary-widget-area',
    		'description' => __( 'The primary widget area', 'nest' ),
    		'before_widget' => '<aside id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    }
    add_action( 'init', 'nest_widgets_init' );
    
    function nest_nav_menus_init() {
    	register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'nest' ) ) );
    }
    add_action( 'init', 'nest_nav_menus_init' );
    
    // set variable $content_width ( WP required )
    $content_width = 630;
    
    /* ========== Shortcodes ========== */
    
    function nest_shortcodes_add() {
    	add_shortcode( 'nest-wpeasyarchives', 'nest_shortcode_wpeasyarchives_handler' );
    	add_shortcode( 'nest-pagelinks',      'nest_shortcode_pagelinks_handler'      );
    }
    add_action( 'init', 'nest_shortcodes_add' );
    
    function nest_shortcode_pagelinks_handler( $atts, $content = null ) {
    	echo '<ul class="nest-box">';
    	wp_list_bookmarks( array(
    		'title_li' => null,
    		'title_before' => '<h3 class="nest-box-title">',
    		'title_after' => '</h3>',
    		'orderby' => 'name'
    	) );
    	echo '';
    }
    
    function nest_shortcode_wpeasyarchives_handler( $atts, $content = null ) {
    	if( function_exists( 'wp_easyarchives' ) ) wp_easyarchives();
    }
    
    /* ========== Scripts and styles ========== */
    
    function nest_init_scripts_and_styles() {
    	global $nest_options;
    	wp_enqueue_script( 'jquery' );
    	wp_enqueue_script( 'nest-menu-arrow', get_template_directory_uri() . '/scripts/nest-menu-arrow.js', array( 'jquery' ) );
    	switch( $nest_options['menu_effect'] ) {
    		case 'fade':
    			wp_enqueue_script( 'nest-menu-effect-fade', get_template_directory_uri() . '/scripts/nest-menu-effect-fade.js', array( 'jquery' ) );
    			break;
    		case 'slide':
    			wp_enqueue_script( 'nest-menu-effect-slide', get_template_directory_uri() . '/scripts/nest-menu-effect-slide.js', array( 'jquery' ) );
    			break;
    		case 'flexible':
    			wp_enqueue_script( 'nest-menu-effect-flexible', get_template_directory_uri() . '/scripts/nest-menu-effect-flexible.js', array( 'jquery' ) );
    			break;
    		default:
    			wp_enqueue_script( 'nest-menu-effect-none', get_template_directory_uri() . '/scripts/nest-menu-effect-none.js', array( 'jquery' ) );
    			break;
    	}
    }
    add_action( 'wp_enqueue_scripts', 'nest_init_scripts_and_styles' );
    
    // make page menu show home link automatically
    if( $nest_options['is_display_homepage_menuitem'] ) :
    function nest_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'nest_page_menu_args' );
    endif;
    
    add_filter( 'use_default_gallery_style', '__return_false' );
    
    function nest_html5_iehack() {
    	echo '<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->';
    }
    add_action( 'wp_head', 'nest_html5_iehack' );
  2. A link to the theme often works better then code snippets.

    http://wordpress.org/extend/themes/nest

    Putting it in the menu maybe problematic as the box would look really out of place in the menu. If you haven't already done so, give this Google search a look. One of those threads may help you out.

  3. ukmark
    Member
    Posted 1 year ago #

    Thanks Jan for your response and the link you provided.. If that's the case I may look for a alternative theme.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags