• Can someone offer some help/suggestions on this please.

    I’ll try and explain as best as I can.

    I have 5 pages on my WordPress (Home, Projects, Services, Showcase and News).

    On my administration page, the “Front Page Display “is set to “Static” with Front Page as “Home” and posts as “News”.

    The problems I have are as follows:

    The front page shows “Home” twice, and the “current_page_item” highlights the second one, never the first. So it’s a combination of a) Showing home twice and b) when you select ‘home’ the current_page_item on picks the second instance.

    The final problem is the “news”, this works fine but the current_page_item highlights “news” AND the first instance of “home”!

    Anyone got any pointers as to what I may be doing wrong?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Without seeing this in action it is hard to know the exact problem, but perhaps try this first.

    Try naming the front page to anything else but ‘home’ and see if it makes a change.

    Thread Starter jmhirst

    (@jmhirst)

    Hi JamesICT, ok good idea, have done that but makes no difference.

    The address if it helps is http://www.northcode.co.uk

    I’m sure you’ll see exactly what I mean.

    (renamed Home to Frontpage, so now the menu shows Home, Frontpage, Services, Projects, Showcase, news)

    Ok, so how are you putting the code in for the top nav bar – manually or listing pages?

    Could you post the code you are using?

    Thread Starter jmhirst

    (@jmhirst)

    Well the code is as follows

    <!-- main menu -->
    	<?php if(function_exists('yy_menu')) : /* yammyamm is installed and function yy_menu exists */ ?>
    		<ul class="menu" id="main_menu">
    
    			<!-- the home is the language root page -->
    			<?php if ($yy_options['home_type']=='page') { ?>
    
    			<li class="<?php if (yy_is_home()) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">
    				<a class="first_menu" href="<?php echo yy_home_url(); ?>">
    					<?php _e($freshy_options['first_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    			</li>
    			<li class="<?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">
    				<a href="<?php echo yy_home_url('blog'); ?>">
    					<?php _e($freshy_options['blog_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    			</li>
    
    			<?php }
    			else { ?>
    			<!-- the home is the language blog category -->
    
    			<li class="<?php if (((is_home()) && !(is_paged())) or (is_archive()) or (is_single()) or (is_paged()) or (is_search())) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">
    				<a class="first_menu" href="<?php echo yy_home_url('blog'); ?>">
    					<?php _e($freshy_options['blog_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    			</li>
    			<!--
    			<li class="<?php if (yy_is_home('page')) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">
    				<a href="<?php echo yy_home_url('page'); ?>">
    					<?php _e($freshy_options['first_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    			</li>
    			-->
    			<?php }?>
    
    			<!-- pages -->
    			<?php yy_menu('sort_column=menu_order&depth=1&title_li=','none'); ?>
    
    			<li class="last_menu">
    
    				<!-- if an email is set in the options -->
    				<?php if ($freshy_options['last_menu_type']=='email') { // the home is language root page ?>
    
    				<a class="last_menu" href="mailto:<?php echo $freshy_options['contact_email']; ?>">
    					<?php _e($freshy_options['last_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    
    				<?php }
    				else if ($freshy_options['last_menu_type']=='link') { // the home is language root page ?>
    
    				<a class="last_menu" href="<?php echo $freshy_options['contact_link']; ?>">
    					<?php _e($freshy_options['last_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    
    				<?php }
    				else { ?>
    				<!-- put an empty link to have the end of the menu anyway -->
    
    				<a class="last_menu_off">
    				</a>
    
    				<?php }?>
    
    			</li>
    
    			<!-- languages flags -->
    			<?php yy_lang_menu('lang_menu'); ?>
    
    		</ul>
    
    	<?php else : /* yammyamm is not installed or function yy_menu does not exist, use default menu */ ?>
    		<ul class="menu">
    
    			<li class="<?php if (is_home()) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">
    				<a class="first_menu" href="<?php echo get_settings('home'); ?>">
    					<?php _e($freshy_options['first_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    			</li>
    
    			<?php freshy_wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
    
    			<li class="last_menu">
    
    				<!-- if an email is set in the options -->
    				<?php if ($freshy_options['last_menu_type']=='email') { // the home is language root page ?>
    
    				<a class="last_menu" href="mailto:<?php echo $freshy_options['contact_email']; ?>">
    					<?php _e($freshy_options['last_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    
    				<?php }
    				else if ($freshy_options['last_menu_type']=='link') { // the home is language root page ?>
    
    				<a class="last_menu" href="<?php echo $freshy_options['contact_link']; ?>">
    					<?php _e($freshy_options['last_menu_label'],TEMPLATE_DOMAIN); ?>
    				</a>
    
    				<?php }
    				else { ?>
    				<!-- put an empty link to have the end of the menu anyway -->
    
    				<a class="last_menu_off">
    				</a>
    
    				<?php }?>
    
    			</li>
    
    		</ul>
    	<?php endif; ?>

    It’s taken directly from this guys theme : http://www.jide.fr/english/downloads/template-freshy-wordpress/

    I’m going to hack it and change it to my own style, but this is the first hurdle I’ve come accross which has me totally stumped.

    I have never used the Freshy theme myself, but reading through this…

    http://www.jide.fr/english/downloads/template-freshy-wordpress/

    I would say that the problem you are experiencing may be related to the same issue that ‘Kenny’ was having in the comments on that page.

    i.e.

    First of all, in the admin, you have to create languages and assign categories and pages to each language. Only posts and pages in these will show up, so if “about” is in root, it won’t display in the menu… Then, if you log in into your admin account, there are options for YammYamm : you can set the homepage as being the language blog root category or as the language root page.

    Thread Starter jmhirst

    (@jmhirst)

    Thanks for that, will have a read through and see if it sheds some light.

    Thanks again.

    Thread Starter jmhirst

    (@jmhirst)

    OK, have tried a few different themes and it seems that every theme has the same problem, so I don’t think it’s specifically aimed towards Freshy now.

    Have deployed a brand new theme, totally different code, layout, etc, and it’s the same problem.

    Has anyone else had these issues?

    Thread Starter jmhirst

    (@jmhirst)

    Right, have now solved the duplicate.

    If anyone is interested, the following works:

    Create a blank page, set it to private.
    On the ‘home’ page, set it’s Page Parent to the new blank page.

    Voila!

    Thanks for taking the time to post your solution. It is always helpful. Glad you worked it out.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Static pages and current_page_item’ is closed to new replies.