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)
-   -   Adding list items to the Page Menu (http://forum.bytesforall.com/showthread.php?t=63)

bseppa Dec 19, 2008 04:22 PM

Adding list items to the Page Menu
 
Flynn - I used to add list items to the Page Menu bar in version 2 of your theme by doing what you see below (I had an "openwindow" javascript method in header.php). Sometimes I wanted to link to an external page and have control over the window that opens. Is this at all possible in version 3?

Code:

<div class="clearfix" id="modernbricksmenu">
    <ul>
        <li class="page_item"><a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('name'); ?>">Home</a></li>
                <?php wp_list_pages('title_li=&depth=1' ); ?>
<li><a href="javascript:openwindow('http://www.url.com','','yes','no','20','20')">Photography</a></li>
                </ul>
</div>

I don't see a call to wp_list_pages, but I could be looking in the wrong place.

B

Flynn Dec 19, 2008 06:41 PM

You can do this in functions/bfa_header_config.php

To add a page, add this:
PHP Code:

$page_menu_bar .= '<li><a href="link">Link Text</a></li>'

or, to add pages and sub pages, add this:

PHP Code:

$page_menu_bar .= '<li class="rMenu-expand"><a href="link">First Level A</a>';
$page_menu_bar .= '   <ul class="rMenu-ver">';
$page_menu_bar .= '   <li><a href="link">Second Level A</a></li>';
$page_menu_bar .= '   <li><a href="link">Second Level B</a></li>';
$page_menu_bar .= '   </ul>';
$page_menu_bar .= '</li>';
$page_menu_bar .= '<li><a href="link">First Level B</a></li>'

...after this code in line 12, if you want the new page links to appear on the left side of the menu bar (before the existing links):

PHP Code:

$page_menu_bar '<div id="menu1"><ul id="rmenu2" class="clearfix rMenu-hor rMenu">' "\n"

...or before this code in line 23, if you want your new page links to appear on the right side of the menu bar (after the existing menu links):

PHP Code:

$page_menu_bar .= '</ul></div>' "\n"

Finally, to make the new links open in a new window, add

PHP Code:

target="_blank" 

to each one of the new page links, like this:

PHP Code:

$page_menu_bar .= '<li><a target="_blank" href="link">Link Text</a></li>'


Flynn Dec 20, 2008 05:11 AM

FIND this in line 23 in functions/bfa_header_config.php:

PHP Code:

$page_menu_bar .= '</ul></div>' "\n"



and ADD this right before it:

PHP Code:

$page_menu_bar .= '<li><a target="_blank" href="url.com">Photography</a></li>'



so that you end up with:

PHP Code:

$page_menu_bar .= '<li><a target="_blank" href="url.com">Photography</a></li>';
$page_menu_bar .= '</ul></div>' "\n"



3ukman Jul 15, 2009 03:03 PM

I have a follow up question about this, I want the tab to point to a category page like this:

http://www.mysite.com/index.php/category/category1/

It works , but after clicking the tab it does not remainHIGHLIGHTED to show that it is the active section.

This only works with pages , doesnt it ?

Flynn Jul 16, 2009 07:36 AM

The highlighting works if you let Wordpress create the <UL> list. If you add items manually, i.e. a link to a category to the page menu bar, you'd have to add the current state of the menu tab as well

<li class="cat-item<?php if ( is_category('Category Name') ) { echo ' current-cat'; } ?>">
<a href="link">Category Name</a></li>

3ukman Jul 17, 2009 04:10 AM

Thanks Flynn,

I get unexpected T_STRING parsing error , could you please quickly verify the syntax for me ?

juggledad Jul 21, 2009 05:13 AM

post the 3 lines above and below the line indicate in the error.

3ukman Jul 23, 2009 11:52 AM

Thanks for all the help , I will hire developer for this one.

juggledad Jul 23, 2009 04:13 PM

fyi, there is a bug in the category menus in ver 3.4.2- the selected page wouldn't remain highlighted in the menu bar. see http://forum.bytesforall.com/showthr...ghlight=bugfix for a fix

mptorr May 4, 2010 01:54 PM

Is the method described by Flynn in post 3 still valid? The code in bfa_header_config seems to have changed a lot since then. Do you have an updated method to insert a link to external website on the pages menu?

Thanks.

juggledad May 4, 2010 02:37 PM

No it's not valid, that post is almost a year and a half old. Do a forum search for 'external link' and you should find the method.

I'm closing this thread due to it's age


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

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