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)
-   -   Don't want main categories on menu bar to be click-able (http://forum.bytesforall.com/showthread.php?t=4070)

kmagyarics Oct 26, 2009 08:36 AM

Don't want main categories on menu bar to be click-able
 
I have a menu bar at the top of my site (www.trywine.net/wordpress) with a few categories (like Writings) with sub categories (Articles and Newsletter.) I want readers to be able to click on Articles and Newsletters and have them go to those pages, but I don't want the site to take them to the general Writings page. How can I make that not clickable, and just a title, I guess? Thanks!

krystyna Oct 27, 2009 05:19 PM

I'm looking for an answer to the same question - to make my drop-down menu items clickable, but the main menu item above that drop down a "non-page." I have several menu items with no drop-downs, only menu item "Products" has a drop-down below it.

krystyna Oct 27, 2009 05:22 PM

Never mind, I just found the trigger in the obvious place - under "Page Menu Bar."

I need to seriously get more sleep. :(

skizzy Nov 9, 2009 08:17 AM

Don't want main categories on menu bar to be click-able
 
The solution describes how to do for PAGE menu bars, but the initial question was related to CATEGORY menu bars.

So please let me ask again how to disable the link for first level parent items in category menu bar?

Are there any plans to add the "Don't link first level parent items in Page Menu Bar?" feature for categories as well?

Thanks in advance!

juggledad Nov 9, 2009 09:03 AM

You could look at the code in bfa_hor_pages.php and see if you could get it to work in bfa_hor_cats.php

That is a good suggestion about adding it to the 'Category Menu Bar', hopefully Flynn wil do it.

If you get the code to works, please publish it and I'll, point flynn at this post.

skizzy Nov 12, 2009 06:46 AM

Hi juggledad, that's very difficult for a non coding noob like me. Here's what I tried out:

The controlling funktion in bfa_hor_pages.php seems to be this one:

Code:

if ( $bfa_ata['page_menu_1st_level_not_linked'] == "Yes" ) {
                $list_pages_string = preg_replace("/<li class=\"(.*?)><a href=\"(.*?)\"(.*?)\n<ul>/i","<li class=\"rMenu-expand \\1><a href=\"#\" onclick=\"return false\"\\3\n <ul class=\"rMenu-ver\">",$list_pages_string);
        } else {
                $list_pages_string = preg_replace("/<li class=\"(.*?)\n<ul>/i","<li class=\"rMenu-expand \\1\n <ul class=\"rMenu-ver\">",$list_pages_string);
        }

Because I have no idea where the variable
Code:

$bfa_ata['page_menu_1st_level_not_linked']
is set, I tried the short way and took the 'If...="yes"-function', edited it for cats and inserted into bfa_hor_cats.php before the line
Code:

$list_cat_string = wp_list_categories('orderby=' . $sort_order ...
as follows:

Code:

$list_cat_string = preg_replace("/<li class=\"(.*?)><a href=\"(.*?)\"(.*?)\n<ul>/i","<li class=\"rMenu-expand \\1><a href=\"#\" onclick=\"return false\"\\3\n <ul class=\"rMenu-ver\">",$list_cat_string);
- Without any effect. - What's wrong? :confused:

Chief Nov 16, 2009 11:55 AM

Quote:

Originally Posted by kmagyarics (Post 17526)
I have a menu bar at the top of my site (www.trywine.net/wordpress) with a few categories (like Writings) with sub categories (Articles and Newsletter.) I want readers to be able to click on Articles and Newsletters and have them go to those pages, but I don't want the site to take them to the general Writings page. How can I make that not clickable, and just a title, I guess? Thanks!

I visited your page and it looks like you found the solution to the issue. Can you tell me what you did? Thanks!

Silverthread Dec 15, 2009 01:44 PM

I too would like to see a check box solution for the category menu, like the pages menu has, for not linking parent items, unless it has no children.

But in the meantime, I need a solution now that will work. Switching to pages instead of posts is not an option.

Thank you for your swift response.

Silverthread

True Jul 31, 2010 06:22 AM

has anyone got a fix for this please?

I can't get the latest version of Atahualpa but I have the version before that. Please tell me what to do to get top level parent category items non clickable.


All times are GMT -6. The time now is 03:20 AM.

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