Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   [SOLVED] Home link in page-right menu order (http://forum.bytesforall.com/showthread.php?t=2838)

reneevt5 Aug 5, 2009 08:36 PM

[SOLVED] Home link in page-right menu order
 
I have my page menu bar set to %page-right in ATO>Style and Edit Header Area.

In this setting, all the pages get sorted in reverse order, with home page last (on the right). I have fixed the other pages by reversing their page order but the Home page stays on the right.

In ATO>Page Menu Bar I have Home in the first box and menu_order chosen for the page order.

www.anovelwritingsite.com

How do I get Home to move to the left side of the list?

juggledad Aug 6, 2009 05:03 AM

The reversal of the menu is due to CSS. To get the menu to the right side, a CSS 'float: Right;' is used. This causes the items to be listed from right to left instead of the normal left to right.

You could set your page order so the item you want to be the left most - when '%page-right' is used has the highest number, nd decrease the page numbers, but it won't help with the 'home' tag.

To move the home tage, you will have to make a code change. This code change will only effect the 'home' tag (but you could use the page order also)

in 3.4.2, edit bfa_header_config.php and find the block of code (lines 22-34)
HTML Code:

        // "Home" Link?
        if ( $bfa_ata['home_page_menu_bar'] != '' ) {
                $page_menu_bar .= '<li class="page_item';
                if (function_exists('is_front_page')) {
                        if ( is_front_page() ) {
                                $page_menu_bar .= ' current_page_item';
                        }
                } elseif ( is_home() ) {
                        $page_menu_bar .= ' current_page_item';       
                }
                $page_menu_bar .= '"
>
<a href="' . $bfa_ata['get_option_home'] . '/" title="' . $bfa_ata['bloginfo_name'] . '">' .
                $bfa_ata['home_page_menu_bar'] . '</a></li>' . "\n";       
        }

and change it to (note add new first line and last line)
HTML Code:

        // "Home" Link?
        if ( strpos($header_items,"%page-right") == FALSE ) {
        if ( $bfa_ata['home_page_menu_bar'] != '' ) {
                $page_menu_bar .= '<li class="page_item';
                if (function_exists('is_front_page')) {
                        if ( is_front_page() ) {
                                $page_menu_bar .= ' current_page_item';
                        }
                } elseif ( is_home() ) {
                        $page_menu_bar .= ' current_page_item';       
                }
                $page_menu_bar .= '"
>
<a href="' . $bfa_ata['get_option_home'] . '/" title="' . $bfa_ata['bloginfo_name'] . '">' .
                $bfa_ata['home_page_menu_bar'] . '</a></li>' . "\n";       
        }
        }

next, cut this enire block of code and add it before the line
HTML Code:

        // Close table if centered
change the first line of this block from
HTML Code:

        if ( strpos($header_items,"%page-right") == FALSE ) {
to
HTML Code:

        if ( strpos($header_items,"%page-right") !== FALSE ) {
that should cause the 'home' tab to be the first item in the menubar, reading from left to right, no matter where the menubar is centered.

aaro Oct 4, 2009 02:29 PM

I had this same problem, and this fixed it! I owe you. However, you may want to change the following instructions:

Quote:

Originally Posted by juggledad (Post 12021)
next, copy this enire block of code and add it before the line
HTML Code:

        // Close table if centered

Since you actually need to cut the section, not copy it. For a CSS noob like me, that word makes the difference between success and aggravation. But thanks again!

juggledad Oct 4, 2009 02:32 PM

Good point - fixed post and changed post #2 the word 'copy' to 'cut'

rinoa3108 Jan 15, 2010 11:39 PM

if we change the .php files though, will we need to add them in again when we upgrade to newer versions of Atahualpa?

juggledad Jan 16, 2010 03:39 AM

That is correct

jdtfk Jan 27, 2010 10:02 AM

I had the same problem.
In my case it was the categories section, so just had to change

Quote:

if ( strpos($header_items,"%page-right") !== FALSE ) {
to

Quote:

if ( strpos($header_items,"%cat-right") !== FALSE ) {
Thanks juggledad.

gasserol Oct 18, 2010 01:16 PM

Hello, is this right for atahualpa 3.5.3 too?
Thanks for your excellent theme!

Sophie Dec 8, 2010 04:50 PM

1 Attachment(s)
Hi there! thank you for your wonderful theme!

It's my first time ever doing this...so, I messed up!
I followed the steps you said above but I have 3.4.9 version. WordPress 3.0.1. and now my header is messed up. no "Home" page anymore and other shifting of spaces in the header place. I put in attach how it looks now my bfa_header_config.php.

pls tell me what changes should I do to get back the "Home" page - and to appear first when the pages are listed on the right side.

pls help!
Gratitude,
Sophie

photomeblack Dec 29, 2010 02:02 PM

In version 3.5.3
Quote:

$page_menu_bar .= '<li class="page_item';
and
Quote:

$page_menu_bar .= '"><a href="' . $bfa_ata['get_option_home'] . '/" title="' . $bfa_ata['bloginfo_name'] . '">' .
appear as below
Quote:

echo '<li class="page_item';
and
Quote:

echo '"><a href="'; bloginfo('url'); echo '/" title="'; bloginfo('name'); echo '">' .
Leaving the code as is, when I follow the procedures in #2 (and #3) there is no change. Is there a different procedure for v3.5.3?

photomeblack Jan 7, 2011 07:17 PM

Solution for Atahualpa 3.5.3 and WordPress 3.0.3: Create your menu list in WordPress Menus, change %pages to %page-right in ATO>Style & edit HEADER AREA>Configure Header Area. Then follow Juggledad's recommendations in #2 above. When you view your page, if your page order on the menu is reversed, reverse the order of your menu elements on the WordPress Menus page.


All times are GMT -6. The time now is 10:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.