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)
-   -   Small Question - Links in Header (http://forum.bytesforall.com/showthread.php?t=103)

JamesFerguson Jan 8, 2009 01:59 PM

Small Question - Links in Header
 
I was able to figure this out in the previous version of Atahualpa, but I'm stumped on this version. I love the way the layout shows the page links on the top of the header. I wanted to use the same style, but instead of page links, provide links to other things (ie: Twitter page, Facebook profile, etc.). I was able to update the header.php file with this before, but I'm unable to figure it out this time. Any help would be greatly appreciated.

Thanks!

Flynn Jan 8, 2009 02:11 PM

In header.php, find

PHP Code:

         <?php bfa_header_config($bfa_ata_configure_header); ?>

and before or after it put this

PHP Code:

 <div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">
<
li><a href="link">Link Text</a></li>
<
li><a href="link">Link Text</a></li>
<
li><a href="link">Link Text</a></li>
<
li><a href="link">Link Text</a></li>
<
li class="rMenu-expand"><a href="link">Link with sub menu</a>
 <
ul class="rMenu-ver">
    <
li><a href="link">Sub menu item 1</a></li>
    <
li><a href="link">Sub menu item 2</a></li>
</
ul>
</
li>
<
li><a href="link">Link Text</a></li>
</
ul></div

This example has second level items, too. Too remove them, remove this part of the code:

PHP Code:

<li class="rMenu-expand"><a href="link">Link with sub menu</a>
 <
ul class="rMenu-ver">
    <
li><a href="link">Sub menu item 1</a></li>
    <
li><a href="link">Sub menu item 2</a></li>
</
ul>
</
li

Finally, still in header.php, find

PHP Code:

 <?php if (strpos($bfa_ata_configure_header,'pages')!==FALSE) { ?>sfHover( 'rmenu2' );<?php ?>

and replace with

PHP Code:

 <?php # if (strpos($bfa_ata_configure_header,'pages')!==FALSE) { ?>sfHover( 'rmenu2' );<?php # } ?>
sfHover( 'rmenu2' );

After you implemented this, don't use the page menu bar (%pages) anymore in Atahualpa Theme Options -> Header. Using both the page menu bar and this custom link menu bar at the same time will cause errors in IE6 and maybe other browsers too.

JamesFerguson Jan 8, 2009 02:30 PM

Wow. Thanks for the quick response. I'm most of the way there. I was able to find and add in the code you suggested. Is there a way to have it appear like the links to the pages do in one of the bars in the header?

JamesFerguson Jan 8, 2009 02:54 PM

Quote:

Originally Posted by Flynn (Post 385)
[/php]Finally, still in header.php, find

PHP Code:

 <?php if (strpos($bfa_ata_configure_header,'pages')!==FALSE) { ?>sfHover( 'rmenu2' );<?php ?>

and replace with

PHP Code:

 <?php # if (strpos($bfa_ata_configure_header,'pages')!==FALSE) { ?>sfHover( 'rmenu2' );<?php # } ?>
sfHover( 'rmenu2' );

After you implemented this, don't use the page menu bar (%pages) anymore in Atahualpa Theme Options -> Header. Using both the page menu bar and this custom link menu bar at the same time will cause errors in IE6 and maybe other browsers too.

Thanks again, Flynn. I was able to do the first part, but this part is holding me up. It seems that I can almost get it to work with the %pages listed in the Theme Options, but that's the opposite of what you suggested. :) Right now the links come up fine and in the correct format, but below them the pages will come up. If I take out the %pages, I get a regular, un-styled vertical list of links instead of the horizontal list.

Flynn Jan 8, 2009 03:20 PM

Update: This post is for Atahualpa up to version 3.1.7.
Atahualpa up to 3.1.7: Use Post #2 + Post #5 (this post)
Atahualpa 3.1.8 and newer: Use Post #2 + Post #10 (see below)

Doh - I forgot one setting. In style.css.php, find

PHP Code:

<?php if (strpos($bfa_ata_configure_header,'%pages')!==false OR strpos($bfa_ata_configure_header,'%cats')!==false) { ?>

and replace with

PHP Code:

<?php # if (strpos($bfa_ata_configure_header,'%pages')!==false OR strpos($bfa_ata_configure_header,'%cats')!==false) { ?>

Still in style.css.php, find

PHP Code:

<?php ?>


/* ------------------------------------------------------------------
---------- HACKS: Clearfix & others ---------------------------------
------------------------------------------------------------------ */

and replace with

PHP Code:

<?php # } ?>


/* ------------------------------------------------------------------
---------- HACKS: Clearfix & others ---------------------------------
------------------------------------------------------------------ */


JamesFerguson Jan 8, 2009 05:24 PM

Thank you so much! That fixed it. Thank you very much for your help with this. I really appreciate it. I'll be donating shortly. :)

Masselyn Jan 30, 2009 11:22 AM

I wonder if I am doing something wrong with this code, because my menu bar (the one mentioned above) comes up fine...looks & works great...but it is showing at the end of the header just above the first post. I want it to be above my header image, where I would have the pages menu show. How can I adjust this?

Thanks.

Flynn Jan 30, 2009 11:52 AM

Have you put the code from post #2 before or after
PHP Code:

<?php bfa_header_config($bfa_ata_configure_header); ?>



And if you're referring to the default page and category menu bars, their order can be re-arranged at Atahualpa Theme Options -> Header ->
Configure Header Area

Masselyn Jan 30, 2009 08:51 PM

Thanks. I see where I went wrong with the placement, and now it is at the top. I do have two more questions and I promise to go away :)

1). I have it at the top, but how can I position it to be below the logo bar and above the image bar? I am trying to play with that without success.
2). I can't get it to work without the %pages in the theme options. If I take that away, the formatting for the new menu bar goes away. I can not find the style.css.php file, to insert that code, but I did find one of the lines of code you mention I should edit in header.php. Should I be making changes there? Perhaps I am working in a different version of the blog. I think I have the newest 3.1.9, but those last edits of code you mention escape me because I can't find that style.css.php file in my directory.

Sorry to throw these out there, but this is the last tweaky thing I want to get wrapped up. I appreciate the past help...and any future. I'm sending a small donation, cause you have been a great help!

Flynn Jan 31, 2009 03:34 AM

You're right, the above does not apply to version 3.1.8 and newer as in 3.1.8 the dynamic CSS was moved from style.css.php to header.php. You should have no style.css.php file anymore in 3.1.8 and newer.

Instead of the changes in post #5 in this thread, do these changes for Atahualpa version 3.1.8 and newer.

In header.php, find:

PHP Code:

<?php if (strpos($bfa_ata_configure_header,'%pages')!==false OR strpos($bfa_ata_configure_header,'%cats')!==false) { ?>

and replace with:

PHP Code:

<?php # if (strpos($bfa_ata_configure_header,'%pages')!==false OR strpos($bfa_ata_configure_header,'%cats')!==false) { ?>

Still in header.php, find:

PHP Code:

<?php ?>    
<?php echo $bfa_ata_html_inserts_css?>

and replace with:

PHP Code:

<?php # } ?>    
<?php echo $bfa_ata_html_inserts_css?>


Flynn Jan 31, 2009 03:54 AM

Quote:

Originally Posted by Masselyn (Post 623)
1). I have it at the top, but how can I position it to be below the logo bar and above the image bar? I am trying to play with that without success.

As for putting it between two default header items, the solution for this would be completely different. The

PHP Code:

<?php bfa_header_config($bfa_ata_configure_header); ?>



part contains all default header items as configured at Atahualpa Theme Options -> Header ->
Configure Header Area

To put something in between those default items, changes would have to be made to functions/bfa_header_config.php.

Like in the examples above one of the two existing menu bars, %cats or %pages would have to sacrificed if you want to use one of them for arbitrary links. To use the page menu bar for this, find, in bfa_header_config.php:

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
if (
$bfa_ata_home_page_menu_bar != '') {
    
$page_menu_bar .= '<li class="page_item';
    if (
function_exists('is_front_page')) {
        if (
is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
        }} elseif (
is_home()) { $page_menu_bar .= ' current_page_item';    }
$page_menu_bar .= '"><a href="' get_option('home') . '/" title="' get_option('blogname') . '">' 
$bfa_ata_home_page_menu_bar '</a></li>' "\n";    
}    
if (
$bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar 0; }    
$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar$bfa_ata_levels_page_menu_bar$bfa_ata_titles_page_menu_bar$bfa_ata_exclude_page_menu_bar);
$page_menu_bar .= '</ul></div></div>' "\n";
// END of Page Menu Bar 

and change to

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
#if ($bfa_ata_home_page_menu_bar != '') {
#    $page_menu_bar .= '<li class="page_item';
#   if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
#        }} elseif (is_home()) { $page_menu_bar .= ' current_page_item';    }
#$page_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' . 
#$bfa_ata_home_page_menu_bar . '</a></li>' . "\n";    
#}    
#if ($bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar = 0; }    
#$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar, $bfa_ata_levels_page_menu_bar, $bfa_ata_titles_page_menu_bar, $bfa_ata_exclude_page_menu_bar);

$page_menu_bar .= '
<li><a href="link">Link 1</a></li>
<li><a href="link">Link 2</a></li>
<li><a href="link">Link 3</a></li>
<li><a href="link">Link 4</a></li>
'
;
$page_menu_bar .= '</ul></div></div>' "\n";
// END of Page Menu Bar 

Do only the changes in this post and NOT the other changes in this thread. Now you can use, position and style the page menu bar %pages at the menu tabs "Page Menu Bar" and "Header" -> "Configure Header Area"

To do the same for the category menu bar instead, in bfa_header_config.php, find:

PHP Code:

// Category Menu Bar 
$cat_menu_bar '<div id="menu2"><ul id="rmenu" class="clearfix rMenu-hor rMenu">' "\n";
if (
$bfa_ata_home_cat_menu_bar != '') {
    
$cat_menu_bar .= '<li class="cat-item';
    if (
function_exists('is_front_page')) {
        if (
is_front_page() OR is_home()) { $cat_menu_bar .= ' current-cat';
        }} elseif (
is_home()) { $cat_menu_bar .= ' current-cat';    }
$cat_menu_bar .= '"><a href="' get_option('home') . '/" title="' get_option('blogname') . '">' 
$bfa_ata_home_cat_menu_bar '</a></li>' "\n";    
}    
if (
$bfa_ata_levels_cat_menu_bar == "") {$bfa_ata_levels_cat_menu_bar 0; }    
$cat_menu_bar .= bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar);
$cat_menu_bar .= '</ul></div>' "\n";
// END of Category Menu Bar 

and change to:
PHP Code:

// Category Menu Bar 
$cat_menu_bar '<div id="menu2"><ul id="rmenu" class="clearfix rMenu-hor rMenu">' "\n";
#if ($bfa_ata_home_cat_menu_bar != '') {
#    $cat_menu_bar .= '<li class="cat-item';
#    if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $cat_menu_bar .= ' current-cat';
#        }} elseif (is_home()) { $cat_menu_bar .= ' current-cat';    }
#$cat_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' . 
#$bfa_ata_home_cat_menu_bar . '</a></li>' . "\n";    
#}    
#if ($bfa_ata_levels_cat_menu_bar == "") {$bfa_ata_levels_cat_menu_bar = 0; }    
#$cat_menu_bar .= bfa_hor_cats($bfa_ata_sorting_cat_menu_bar, $bfa_ata_levels_cat_menu_bar, $bfa_ata_titles_cat_menu_bar, $bfa_ata_exclude_cat_menu_bar);

$cat_menu_bar .= '
<li><a href="link">Link 1</a></li>
<li><a href="link">Link 2</a></li>
<li><a href="link">Link 3</a></li>
<li><a href="link">Link 4</a></li>
 '
;
$cat_menu_bar .= '</ul></div>' "\n";
// END of Category Menu Bar 


Flynn Jan 31, 2009 03:55 AM

Quote:

Originally Posted by Masselyn (Post 623)
I'm sending a small donation, cause you have been a great help!

Thank you, Masselyn.

sagatr Jan 31, 2009 04:04 PM

I have used your code for the category menu bar. Everything works fine. However when i click on certain links & that page is displayed, the hover effect does not stay selected to show the current page we are on.

For example for my normal state of "menu link" colour is blue. If i hover over the links it it goes red.
If i click on the link that page should displayed, and link should stay red to show you are reading the current page.

This is how the original menu works. I tried for hours but cant get it to work.

Can you please help me.

Flynn Jan 31, 2009 04:16 PM

So you're using this for internal pages, not for links to outside pages (on external websites)? Because then you could just use the page and category menu as they are?

Just to go sure that you know this: There is a whole fully functional "Category Menu Bar" that you can enable by putting %cats into Configure Header Area at Atahualpa Site Admin -> Header

If you still need it, the category li items get the following additional classes when they are current or parent of current

For the current cat
HTML Code:

.current-cat
For the parent of the current cat
HTML Code:

.current-cat-parent
So you would add these classes to i.e. the hover class to give it the same background color:

HTML Code:

ul#rmenu li.current-cat a:link,
ul#rmenu li.current-cat a:active,
ul#rmenu li.current-cat a:hover,
ul#rmenu li.current-cat a:visited,
ul#rmenu li a:hover
    {
    background-color: #123456;
    color: #123456;
    }


Masselyn Jan 31, 2009 08:45 PM

Ha! Genius! Thanks again. Gee, I'm feeling a little sheepish at throwing another question at you...but with this method of creating a custom nav bar with links (which is working fabulously)...is there a way to make the category links work the same as they would if I went the "normal" nav bar route? Does that make sense? Basically, I would love to have a Category choice on my new nav bar, which automatically drops down the categories that are built into the WP blog. I was playing around with some code, but I am primarily an HTML designer...and though I usually can manipulate PHP pretty well...most of it still escapes me. :)

sagatr Feb 1, 2009 03:11 AM

Quote:

Originally Posted by Flynn (Post 649)
So you're using this for internal pages, not for links to outside pages (on external websites)?

Thanks for the reply.

I am using external links. I have tried your suggestion by creating additional class. But It does not work.
It seems like it is over ridden by the settings in Site Admin -> Header.

Basicly i am using the category menu as it is but want external links. I want the hover & active link to work like the original. In my case the hover works perfectly but the active link does not work (it goes back to default state).

Steve_T Feb 1, 2009 05:36 AM

Hmmm - this thread has got confusing

I'm using 3.1.9 and I want to create external links in the page menu

do I take it that I add the code in post #10 and then use the other stuff from post #2 ??

Flynn Feb 1, 2009 06:46 AM

Quote:

Originally Posted by Steve_T (Post 666)
Hmmm - this thread has got confusing

I'm using 3.1.9 and I want to create external links in the page menu

do I take it that I add the code in post #10 and then use the other stuff from post #2 ??

For Atahualpa version 3.1.8 and newer use post #2 and post #10.

I updated post #5 to make that clear.

Flynn Feb 1, 2009 06:55 AM

Quote:

Originally Posted by Masselyn (Post 651)
Ha! Genius! Thanks again. Gee, I'm feeling a little sheepish at throwing another question at you...but with this method of creating a custom nav bar with links (which is working fabulously)...is there a way to make the category links work the same as they would if I went the "normal" nav bar route? Does that make sense? Basically, I would love to have a Category choice on my new nav bar, which automatically drops down the categories that are built into the WP blog. I was playing around with some code, but I am primarily an HTML designer...and though I usually can manipulate PHP pretty well...most of it still escapes me. :)

Try this... not tested:

PHP Code:

 <div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li class="rMenu-expand"><a href="#">Categories</a>
 <ul class="rMenu-ver">
    <?php echo bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar); ?>
</ul>
</li>
<li><a href="link">Link Text</a></li>
</ul></div>

In this example the "Categories" link would link nowhere ("#") if clicked but should drop down when hovered. Instead of "#" you could also put a hard coded link to i.e. the archives page there, if you created one.

Flynn Feb 1, 2009 07:07 AM

Quote:

Originally Posted by sagatr (Post 659)
Thanks for the reply.

I am using external links. I have tried your suggestion by creating additional class. But It does not work.
It seems like it is over ridden by the settings in Site Admin -> Header.

Basicly i am using the category menu as it is but want external links. I want the hover & active link to work like the original. In my case the hover works perfectly but the active link does not work (it goes back to default state).

Just to be sure about the difference between "active" and "current".

"Current" would not be possible with external links. Web site A would not know that you're on page X of web site B. That would require Javascript and tricky cookie settings, probably with a third domain/subdomain to handle the cookies for both domains.

"Active" should work, but I am not sure how persistent that "active" highlighting is:

HTML Code:

ul#rmenu li.current-cat a:link,
ul#rmenu li.current-cat a:active,
ul#rmenu li.current-cat a:hover,
ul#rmenu li.current-cat a:visited,
ul#rmenu li a:hover,
ul#rmenu li a:active
    {
    background-color: #123456;
    color: #123456;
}

I've added ul#rmenu li a:active to the earlier example from this thread.

sagatr Feb 1, 2009 11:13 AM

unfortunately the above code does not work. Where are you placing the code in : themes/atahualpa/style.css

Flynn Feb 1, 2009 12:25 PM

Quote:

Originally Posted by sagatr (Post 687)
unfortunately the above code does not work. Where are you placing the code in : themes/atahualpa/style.css

You would put that into HTML/CSS Inserts -> CSS Inserts

The order CSS is being processed is style.css -> Theme Options (header.php) -> CSS Inserts (header.php bottom)

Masselyn Feb 1, 2009 03:09 PM

Quote:

Originally Posted by Flynn (Post 669)
Try this... not tested:

PHP Code:

 <div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li class="rMenu-expand"><a href="#">Categories</a>
 <ul class="rMenu-ver">
    <?php echo bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar); ?>
</ul>
</li>
<li><a href="link">Link Text</a></li>
</ul></div>

In this example the "Categories" link would link nowhere ("#") if clicked but should drop down when hovered. Instead of "#" you could also put a hard coded link to i.e. the archives page there, if you created one.


Thanks for the quick reply, but the categories are no longer dropping. Or, rather the menu is no longer dropping. I have the arrows, showing that it "thinks" it should be showing me sub-menus...but nothing happens. Any other thoughts?

Flynn Feb 1, 2009 03:35 PM

Quote:

Originally Posted by Masselyn (Post 700)
Thanks for the quick reply, but the categories are no longer dropping. Or, rather the menu is no longer dropping. I have the arrows, showing that it "thinks" it should be showing me sub-menus...but nothing happens. Any other thoughts?

Can you post or PM a URL, that'll make it much easier for me

Masselyn Feb 1, 2009 03:53 PM

Quote:

Originally Posted by Flynn (Post 703)
Can you post or PM a URL, that'll make it much easier for me

Sure...the temp location for this blog, as I work on it, is www.masselyn.com/mikifoto Right now I had just copied/pasted the code you gave me...so the links are generic at the moment. Hope that helps, and if you need more information or for me to change something...just let me know.

:)

Thanks SO much!

Flynn Feb 1, 2009 04:35 PM

My bad, I lost track about the context in which that code would be posted (inside php tags)

The complete replacement code as per post #11 in this thread, first part (for page menu bar) would be

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
#if ($bfa_ata_home_page_menu_bar != '') {
#    $page_menu_bar .= '<li class="page_item';
#   if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
#        }} elseif (is_home()) { $page_menu_bar .= ' current_page_item';    }
#$page_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' . 
#$bfa_ata_home_page_menu_bar . '</a></li>' . "\n";    
#}    
#if ($bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar = 0; }    
#$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar, $bfa_ata_levels_page_menu_bar, $bfa_ata_titles_page_menu_bar, $bfa_ata_exclude_page_menu_bar);

$page_menu_bar .= '
<li><a href="link">Link 1</a></li>
<li><a href="link">Link 2</a></li>
<li><a href="link">Link 3</a></li>
<li><a href="link">Link 4</a></li>
<li class="rMenu-expand"><a href="#">Categories</a> 
 <ul class="rMenu-ver">
'
;
$page_menu_bar .=  bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar);
$page_menu_bar .= '
 </ul> 
</li> 
<li><a href="link">Link Text</a></li>'
;
$page_menu_bar .= '</ul></div></div>' "\n";
// END of Page Menu Bar 

There may still be issues with this but it should be better now


Masselyn Feb 1, 2009 04:51 PM

Quote:

Originally Posted by Flynn (Post 706)
My bad, I lost track about the context in which that code would be posted (inside php tags)

The complete replacement code as per post #11 in this thread, first part (for page menu bar) would be

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
#if ($bfa_ata_home_page_menu_bar != '') {
#    $page_menu_bar .= '<li class="page_item';
#   if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
#        }} elseif (is_home()) { $page_menu_bar .= ' current_page_item';    }
#$page_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' . 
#$bfa_ata_home_page_menu_bar . '</a></li>' . "\n";    
#}    
#if ($bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar = 0; }    
#$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar, $bfa_ata_levels_page_menu_bar, $bfa_ata_titles_page_menu_bar, $bfa_ata_exclude_page_menu_bar);

$page_menu_bar .= '
<li><a href="link">Link 1</a></li>
<li><a href="link">Link 2</a></li>
<li><a href="link">Link 3</a></li>
<li><a href="link">Link 4</a></li>
<li class="rMenu-expand"><a href="#">Categories</a> 
 <ul class="rMenu-ver">
'
;
$page_menu_bar .=  bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar);
$page_menu_bar .= '
 </ul> 
</li> 
<li><a href="link">Link Text</a></li>'
;
$page_menu_bar .= '</ul></div></div>' "\n";
// END of Page Menu Bar 

There may still be issues with this but it should be better now



You've been the best. It is working now. I am playing around with trying to get the drop down to be beneath the main category button. I'll see my way through. Frankly, that is how I am learning so much about all of this side of development (instead of just HTML design), and you have been such a great help!!!

Flynn Feb 1, 2009 05:09 PM

You're almost there... The trouble you're still having is because you're closing the parent's <LI> too early. Compare the following with your code (Note: I left out the opening 2 div's and 1 ul and their closing counterparts because you have those right):

HTML Code:

<li><a href="index.php">Home</a></li>
<li><a href="#">About</a>
  <ul class="rMenu-ver">
      <li><a href="test-page">About Mallika</a></li>
      <li><a href="http://www.mikifoto.com">Website</a></li>
      <li><a href="link">Session Info</a></li>
  </ul>
</li><!-- "About" parent closing here -->
<li><a href="prices">Pricing</a></li>
<li><a href="#">Contact</a>
  <ul class="rMenu-ver">
      <li><a href="mailto:xxxx@xxxxxxx.com">xxxxx@xxxxxxx.com</a></li>
      <li><a href="#">888.555.1212</a></li>
  </ul>
</li><!-- "Contact" parent closing here -->
<li class="rMenu-expand"><a href="#">Categories</a>
  <ul class="rMenu-ver">
      <li><a href="http://masselyn.com/mikifoto/category/categories/kids/" title="View all posts filed under Kids">Kids</a></li>
      <li><a href="http://masselyn.com/mikifoto/category/categories/simple/" title="View all posts filed under Simple Photos">Simple Photos</a></li>
  </ul>
</li><!-- "Categories" parent closing here -->
<li><a href="link">Link Text</a></li>

Note how the parent's <li> is not getting closed on the same line (it might seem they should - but they should not). The parent <LI>'s get closed with </li> AFTER all their children (which themselves are enclosed inside <ul class="rMenu-ver"> ... </ul> )

Masselyn Feb 1, 2009 05:17 PM

I caught one place I did that, and realized how the heck would it know to do something if I closed it off before telling it what to do. I'll go through the code carefully, and check all areas to see where else I messed up. I got it to work at one point, but it threw the categories onto another line. Yikes....trial and error, I'll tell ya. Trial and Error!

More to come...

Masselyn Feb 1, 2009 05:24 PM

Perhaps I am missing something, because it all appears to be closing at the right part. The issue is that the category has a choice on the main bar, then drops down with another category choice and then flys out to the right with the actual categories. I was trying to have the categories drop down from the main choice on the top. When I remove the following lines:
HTML Code:

<a href="#">Categories</a> <ul class="rMenu-ver">
- it works, but throws the whole category menu under the "home" link..therefore putting things on two lines. Does that make sense? I'll post what my current code looks like, cause I'm sure it will make more sense to you than me.

HTML Code:

// Page Menu Bar
$page_menu_bar = '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' . "\n";
#if ($bfa_ata_home_page_menu_bar != '') {
#    $page_menu_bar .= '<li class="page_item';
#  if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
#        }} elseif (is_home()) { $page_menu_bar .= ' current_page_item';    }
#$page_menu_bar .= '"
>
<a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' .
#$bfa_ata_home_page_menu_bar . '</a></li>' . "\n";   
#}   
#if ($bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar = 0; }   
#$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar, $bfa_ata_levels_page_menu_bar, $bfa_ata_titles_page_menu_bar, $bfa_ata_exclude_page_menu_bar);

$page_menu_bar .= '
<li><a href="index.php">Home</a></li>
<li class="rMenu-expand"><a href="#">About</a>
<ul class="rMenu-ver">
    <li><a href="test-page">About Mallika</a></li>
    <li><a href="http://www.mikifoto.com">Website</a></li>
        <li><a href="link">Session Info</a></li>
</ul>
</li>
<li><a href="prices">Pricing</a></li>
<li class="rMenu-expand"><a href="#">Contact</a>
<ul class="rMenu-ver">
    <li><a href="mailto:xxxx.com">xxxx.com</a></li>
    <li><a href="#">888.555.1212</a></li>
</ul>
</li>
<li><a href="archives">Archives</a></li>
<li class="rMenu-expand"><a href="#">Categories</a>
 <ul class="rMenu-ver">
';
$page_menu_bar .=  bfa_hor_cats($bfa_ata_sorting_cat_menu_bar, $bfa_ata_levels_cat_menu_bar, $bfa_ata_titles_cat_menu_bar, $bfa_ata_exclude_cat_menu_bar);
$page_menu_bar .= '
 </ul>
</li>';
$page_menu_bar .= '</ul></div></div>' . "\n";
// END of Page Menu Bar


Flynn Feb 1, 2009 06:26 PM

The problem is that "rMenu-ver" appears twice in the "Category" path but it should only appear max once below a top level parent.

Since you have 2 levels in your Wordpress-created categories (parent "categories" and their childs) you can use this easier version below and use that existing parent "categories" as the top level.

The version from above would have been for a flat list of only-top-level categories.

This is something I had not thought about. "rMenu-ver" can only appear once below each top level parent, and including the categories into the page menu bar via bfa_hor_cats as shown here in this thread will only work if

1) The included categories are all one flat level -> use code from post #30)
2) or they START with a parent that contains all child categories, without further levels (you can set the category order only to some extent at Atahualpa Theme Options -> Category Menu Bar, to bring the parent cat into the first place) -> use code from post #31 = this post here
3) otherwise bfa_hor_cats.php would have to edited, too, but this thread is complicated enough as it is

Move all child categories to the first level and use the code from post #30

Or

Leave them as they are (parent category "categories" with childs) and delete the hard coded "Categories" parent like this:

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><div class="clearfix rMenu-center"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
#if ($bfa_ata_home_page_menu_bar != '') {
#    $page_menu_bar .= '<li class="page_item';
#   if (function_exists('is_front_page')) {
#        if (is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
#        }} elseif (is_home()) { $page_menu_bar .= ' current_page_item';    }
#$page_menu_bar .= '"><a href="' . get_option('home') . '/" title="' . get_option('blogname') . '">' . 
#$bfa_ata_home_page_menu_bar . '</a></li>' . "\n";    
#}    
#if ($bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar = 0; }    
#$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar, $bfa_ata_levels_page_menu_bar, $bfa_ata_titles_page_menu_bar, $bfa_ata_exclude_page_menu_bar);

$page_menu_bar .= '
<li><a href="index.php">Home</a></li>
<li class="rMenu-expand"><a href="#">About</a>
<ul class="rMenu-ver">
    <li><a href="test-page">About Mallika</a></li>
    <li><a href="http://www.mikifoto.com">Website</a></li>
    <li><a href="link">Session Info</a></li>
</ul>
</li>
<li><a href="prices">Pricing</a></li>
<li class="rMenu-expand"><a href="#">Contact</a>
<ul class="rMenu-ver">
    <li><a href="mailto:xxxx.com">xxxx.com</a></li>
    <li><a href="#">888.555.1212</a></li>
</ul>
</li>
<li><a href="archives">Archives</a></li>
'
;
$page_menu_bar .=  bfa_hor_cats($bfa_ata_sorting_cat_menu_bar$bfa_ata_levels_cat_menu_bar$bfa_ata_titles_cat_menu_bar$bfa_ata_exclude_cat_menu_bar);
$page_menu_bar .= '<li><a href="archives">Archives</a></li>
</ul></div></div>' 
"\n";

// END of Page Menu Bar 


Masselyn Feb 1, 2009 07:40 PM

Ha. I had forgotten about creating that silly "categories" category. I didn't intend to keep that, and since removing it I see what you are talking about. It works! It's amazing, and you're talented. I have to see if the person I am doing this for intends to have top level categories only....or will have children categories that I need to take the above code into account.

You've been wonderful. A wealth of information and knowledge. Thanks so much!!

Steve_T Feb 2, 2009 11:43 PM

hello

I'm using 3.1.9 of your excellent theme. I believe it should be packaged with Wordpress as the "Only theme you'll ever need"

I have followed your instructions in post #10 and #2 and have the following

http://digitalvillage.org.uk/blog/

almost right but the extra links appear on a new line - how do I get them to follow on in a straight line from the other links?

Thanks

Flynn Feb 3, 2009 04:55 AM

Quote:

Originally Posted by Steve_T (Post 740)
hello

I'm using 3.1.9 of your excellent theme. I believe it should be packaged with Wordpress as the "Only theme you'll ever need"

I have followed your instructions in post #10 and #2 and have the following

http://digitalvillage.org.uk/blog/

almost right but the extra links appear on a new line - how do I get them to follow on in a straight line from the other links?

Thanks

You got two menu bars, the first is being closed after "Research Blog", and then a new one is opened.
HTML Code:

<li><a href="http://digitalvillage.org.uk/blog/?page_id=53" >Research Blog</a></li>
</ul></div> <--- closed
<div id="menu1">
<ul id="rmenu2" class="clearfix rMenu-hor rMenu"> <-- re-opened
<li>
<a href="link">Link Text</a></li>

should be:

HTML Code:

<li><a href="http://digitalvillage.org.uk/blog/?page_id=53" >Research Blog</a></li>
<li><a href="link">Link Text</a></li>


Steve_T Feb 3, 2009 10:13 AM

I don't understand

I've edited header.php as per posts #2 and #10
I don't see the following HTML in header php

HTML Code:

<li><a href="http://digitalvillage.org.uk/blog/?page_id=53" >Research Blog</a></li>
</ul></div> <--- closed
<div id="menu1">
<ul id="rmenu2" class="clearfix rMenu-hor rMenu"> <-- re-opened
<li>
<a href="link">Link Text</a></li>

I don't see this HTML in header.php - I simply pasted the code you suggested after

PHP Code:

<?php bfa_header_config($bfa_ata_configure_header); ?>


Flynn Feb 3, 2009 12:05 PM

This thread got a bit messy, but...

The post #2 plus the required extra changes (post #5 for Atahualpa up to 3.1.7, and post #10 for Atahualp 3.1.8 and later) was for replacing the whole page menu bar and using its CSS & Javascript for a menu bar full of arbitrary links instead. You want to append arbitrary links to the page menu bar (and keep using the page menu bar with its "Page" page links).

To do that find, in bfa_header_config.php, line 11-24, find this:

PHP Code:

 // Page Menu Bar 
$page_menu_bar '<div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
if (
$bfa_ata_home_page_menu_bar != '') {
    
$page_menu_bar .= '<li class="page_item';
    if (
function_exists('is_front_page')) {
        if (
is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
        }} elseif (
is_home()) { $page_menu_bar .= ' current_page_item';    }
$page_menu_bar .= '"><a href="' get_option('home') . '/" title="' get_option('blogname') . '">' 
$bfa_ata_home_page_menu_bar '</a></li>' "\n";    
}    
if (
$bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar 0; }    
$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar$bfa_ata_levels_page_menu_bar$bfa_ata_titles_page_menu_bar$bfa_ata_exclude_page_menu_bar);
$page_menu_bar .= '</ul></div>' "\n";
// END of Page Menu Bar 

and replace all that with this:

PHP Code:

 // Page Menu Bar 
$page_menu_bar '<div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
if (
$bfa_ata_home_page_menu_bar != '') {
    
$page_menu_bar .= '<li class="page_item';
    if (
function_exists('is_front_page')) {
        if (
is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
        }} elseif (
is_home()) { $page_menu_bar .= ' current_page_item';    }
$page_menu_bar .= '"><a href="' get_option('home') . '/" title="' get_option('blogname') . '">' 
$bfa_ata_home_page_menu_bar '</a></li>' "\n";    
}    
if (
$bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar 0; }    
$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar$bfa_ata_levels_page_menu_bar$bfa_ata_titles_page_menu_bar$bfa_ata_exclude_page_menu_bar);

$page_menu_bar .='
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li class="rMenu-expand"><a href="link">Link with sub menu</a>
   <ul class="rMenu-ver">
      <li><a href="link">Sub menu item 1</a></li>
      <li><a href="link">Sub menu item 2</a></li>
   </ul>
</li>
<li><a href="link">Link Text</a></li>
'
;

$page_menu_bar .= '</ul></div>' "\n";
// END of Page Menu Bar 


Flynn Feb 3, 2009 12:14 PM

And to append 3 levels of arbitrary links to the page menu bar (instead of only 2 levels as shown in post #36 above), use this as the replacement code in bfa_header_config.php:

PHP Code:

// Page Menu Bar 
$page_menu_bar '<div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n";
if (
$bfa_ata_home_page_menu_bar != '') {
    
$page_menu_bar .= '<li class="page_item';
    if (
function_exists('is_front_page')) {
        if (
is_front_page() OR is_home()) { $page_menu_bar .= ' current_page_item';
        }} elseif (
is_home()) { $page_menu_bar .= ' current_page_item';    }
$page_menu_bar .= '"><a href="' get_option('home') . '/" title="' get_option('blogname') . '">' 
$bfa_ata_home_page_menu_bar '</a></li>' "\n";    
}    
if (
$bfa_ata_levels_page_menu_bar == "") {$bfa_ata_levels_page_menu_bar 0; }    
$page_menu_bar .= bfa_hor_pages($bfa_ata_sorting_page_menu_bar$bfa_ata_levels_page_menu_bar$bfa_ata_titles_page_menu_bar$bfa_ata_exclude_page_menu_bar);

$page_menu_bar .='
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li><a href="link">Link Text</a></li>
<li class="rMenu-expand"><a href="link">Link with sub menu</a>
       <ul class="rMenu-ver"> <!-- class "rMenu-ver" for 2nd level ul -->
             <li><a href="link">Sub menu item 1</a></li>
             <li><a href="link">Sub menu item 2</a></li>
       </ul>
</li>
<li class="rMenu-expand"><a href="link">Link with sub menu</a>
       <ul class="rMenu-ver">  <!-- class "rMenu-ver" for 2nd level ul -->
             <li><a href="link">Sub menu item 1</a></li>
             <li class="rMenu-expand"><a href="link">Sub menu item with sub menu</a>
                    <ul> <!-- NO "rMenu-ver" for 3rd or deeper level ul -->
                           <li><a href="link">3rd level item 1</a></li>
                           <li><a href="link">3rd level item 2</a></li>
                    </ul>
             </li>
       </ul>
</li>
<li><a href="link">Link Text</a></li>
'
;

$page_menu_bar .= '</ul></div>' "\n";
// END of Page Menu Bar 


Steve_T Feb 3, 2009 02:57 PM

Thanks Flynn - that's exactly what wanted. You're the top WP theme dude

Webmason Feb 20, 2009 01:12 PM

Thank You!
Very helpful! That's what I needed too.
Any chance of integrating this into the "Page Menu Bar" section of the theme?

Also, do these links have to apear after the other internal pages or is there a way to set their order too? I would like intersperse them with the other page tabs if possible. Asking to much? ;)

jockoe Feb 24, 2009 06:03 PM

I had this same question and was diven a very simple solution by a Mod at the WP forums.
Quote:

copy this file
http://codex.wordpress.org/User:MichaelH/Redirectify
name it redirectify.php
drop in plugins folder
activate plugin
create page - title only
in custom field specify
redirect
with url value of
http://example.com/blog/whatever.pdf

clicking on page title sends you to pdf
It is an easy solution for users that are uncomfortable editing PHP code, like myself.


All times are GMT -6. The time now is 04:08 PM.

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