Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

[SOLVED] How do I make one custom link in the Pages Menu?


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Sep 18, 2009, 09:27 AM
iPuppet's Avatar
iPuppet
 
12 posts · Aug 2009
Washington, DC
[SOLVED] How do I make one custom link in the Pages Menu?

I don't see this posted anywhere, and don't know if it is possible, but I would like to link one tab in the pages menu to an outside url, e.g., my ticket vendor. I have other links available, but a link on the ticket tab would be quite elegant. For now, the tab goes to a dummy page on my website. The alternative is to eliminate the page altogether and rely on other buttons, which are working now thanks to juggledad catching my error.
  #2  
Old Sep 18, 2009, 02:58 PM
Flynn's Avatar
Flynn
 
3,754 posts · Oct 2008
Munich, Germany
Add this to the bottom of Atahualpa's functions.php

PHP Code:
<?php function replace_menu_link($string) {
return 
str_replace('http://www.yoursite.com/link/to/dummypage/',
    
'http://www.othersite.com/link.html'$string);
}
add_filter('wp_list_pages''replace_menu_link');
?>
To replace several links use this instead

PHP Code:
<?php function replace_menu_link($string) {
$old_urls = array('http://www.yoursite.com/tobe/replaced/'
    
'http://www.yoursite.com/tobe/replaced2/'
    
'http://www.yoursite.com/tobe/replaced3/');
$new_urls = array('http://www.othersite.com/link1.html'
    
'http://www.othersite.com/link2/'
    
'http://www.othersite.com/3rdlink/');
$string str_replace($old_urls$new_urls$string);
return 
$string;
}
add_filter('wp_list_pages''replace_menu_link');
?>
  #3  
Old Sep 19, 2009, 08:18 AM
andreigoea
 
1 posts · Sep 2009
Hello,

I've modified links in the menu using both this method as well as the redirector plug-in.

The issue with both is, however, that when clicked on, while viewing the linked page, the menu item does not change status to :active so all stiling is lost.

The item is still "page_item page-item-6" as opposed to:"page_item page-item-9 current_page_item"

Is there any way around this?

Thank you.
  #4  
Old Sep 19, 2009, 10:38 PM
iPuppet's Avatar
iPuppet
 
12 posts · Aug 2009
Washington, DC
Flynn, this did exactly what I needed. Thank you so much for the great template and the support. What versatility! You are to be congratulated on a superb piece of work.
  #5  
Old Sep 21, 2009, 07:11 AM
Flynn's Avatar
Flynn
 
3,754 posts · Oct 2008
Munich, Germany
Quote:
Originally Posted by andreigoea
Hello,

I've modified links in the menu using both this method as well as the redirector plug-in.

The issue with both is, however, that when clicked on, while viewing the linked page, the menu item does not change status to :active so all stiling is lost.

The item is still "page_item page-item-6" as opposed to:"page_item page-item-9 current_page_item"

Is there any way around this?

Thank you.
You could try adding to js.php after

PHP Code:
jQuery(document).ready(function(){ 
this:

PHP Code:
jQuery('ul#rmenu2 li a').click(function() {
    
jQuery('ul#rmenu2 li').removeClass('current_page_item');
    
jQuery(this).parent().addClass('current_page_item');

  #6  
Old Sep 23, 2009, 12:03 PM
sunnivie
 
16 posts · Sep 2009
Flynn,

The piece of code you mentioned first did EXACTLY the right thing for my site as well. Thank you so much for posting it!

One final nit-picky question: is it possible to make the (Atahualpa) blog home page (or the primary page) tab be the SECOND tab listed? I've been able to re-order the other pages in the correct hierarchy through the Pages function, but I don't see how to rearrange the order of the primary blog page.

I'm redesigning the blog for my publication, and the page tabs each link to pages back on the existing homepage in the menu bar, which is already in a set order at www.outfrontcolorado.com. (That menu bar is the order I need to mimic.)

Essentially, what I need to do is switch the first and second page tabs on my menu bar at www.outfrontcolorado.com/blog

I'm running WP 2.8.3 with Atahualpa 3.4.2.

My guess is this is a simple fix, I'm just missing something. Thank you for your help and this fantastic theme and forum.
  #7  
Old Sep 24, 2009, 03:43 AM
juggledad's Avatar
juggledad
 
21,980 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
If you have a static landing page, then this is easy.
1) define a 'page' for the blog - name it what ever
2) at dashboard->settings->reading set your landing page and blog page
3) at ATO->Page Menu Bar->Home link in Page Menu Bar - blank out this entry
4) set ATO->Page Menu Bar->Sorting order of Page Menu Bar to 'menu-order'
4) give each page an 'order' to match how you want it in the menu (dashboard->page->edit->'yourpage'->order

and you should be all set
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support

Last edited by juggledad; Oct 27, 2009 at 11:18 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single Post Pages--How to make post title a link? chainpin Atahualpa 3 Wordpress theme 4 Aug 20, 2009 01:02 PM
How do I make a pop up page when I click a link in my post? sri78 Forum How-To 1 Jun 18, 2009 06:51 AM
How to make the Pages display in sidebar, show only the Parent Main Pages Leoni Sidebars & Widgets 2 May 27, 2009 12:13 AM
Need help creating pages with custom settings and widgets Humphrey Sidebars & Widgets 1 Apr 21, 2009 09:14 AM
Adding custom pages to menu FH4U Page & Category Menu Bars 2 Feb 9, 2009 02:31 PM


All times are GMT -6. The time now is 03:17 PM.


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