WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Center menu for elegantthemes deepfocus template (4 posts)

  1. .stark.
    Member
    Posted 1 year ago #

    Hi,

    I have searched and tried the solution provided in this forum, but it does not work for my website: http://versaillesinterior.com/

    Below are the files involved for the menu. I not sure what to change to make the menu item centered.

    Stylesheet CSS file:

    #header { height: 100px; }
    /*body#home-featured #header {height: 202px;}*/
    	#home-top { background:url("images/top-bg.png") repeat-x bottom left #D2D2D2; width: 100%; height: 102px; position: absolute; top: -1px; left: 0px; z-index: 1; border-bottom:1px solid #FFFFFF; }
    
    	#logo { display: block; margin-left: auto; margin-right: auto; }
    
    	#menu { position: absolute; top: 46px; left: 0px; background: url(images/menu-bg.png) no-repeat; width: 960px; height: 55px; }

    Header file:

    <div id="menu" class="clearfix">
    					<?php $menuClass = 'nav';
    					$menuID = 'primary';
    					$primaryNav = '';
    					if (function_exists('wp_nav_menu')) {
    						$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) );
    					};
    					if ($primaryNav == '') { ?>
    						<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
    							<?php if (get_option('deepfocus_home_link') == 'on') { ?>
    								<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('Home','DeepFocus') ?></a></li>
    							<?php }; ?>
    
    							<?php show_page_menu($menuClass,false,false); ?>
    
    							<?php show_categories_menu($menuClass,false); ?>
    						</ul> <!-- end ul#nav -->
    					<?php }
    					else echo($primaryNav); ?>
    
    				</div> <!-- end #menu -->

    Thanks in advance for helping! :)

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Thanks in advance for helping

    WordPress forums does not provide support for commercial themes.
    You need seek help from the vendor.

  3. Maneetpuri
    Member
    Posted 1 year ago #

    add this code and your menu will be centered.
    ul.nav
    {
    float:left;
    padding: 20px 0 0 4px;
    margin-left:280px
    }

    Hope this helps!

  4. .stark.
    Member
    Posted 1 year ago #

    Thanks Maneetpuri! It works! :)

Topic Closed

This topic has been closed to new replies.

About this Topic