Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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?


  #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,768 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,768 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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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 08:47 AM.


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