tsl

Word Press Navt Plugin for Static Homepage

By Head Lounger • December 19th, 2008 • Word Press Tags: , , ,

I had a project come in that need the Word Press backbone. I like using Navt plugin for navigation. The wysiwyg is very user friendly and clients can figure it out pretty fast.  I ran into a bug with the static home page setting in wordpress and the Navt Plugin. The active setting wouldn’t trigger for the home tab. It would work on all other menu items, but not the home page.

I ran into this article here.

Very helpful article, but I noticed it wasnt working like I needed. The active was contantly staying on, no matter what menu item you were on.  So I figured I’d publish the fix that worked for me. Maybe it would be helpful to anyone searching.

Go to: /wp-content/plugins/wordpress-navigation-list-plugin-navt/app/navt_fe.php

Add the following at line 228:

// Hack to fix static front page problem
$show_on_front = get_option('show_on_front') ;

if ($show_on_front == ‘page’ && get_option(‘page_on_front’) && is_page(get_option(‘page_on_front’)) )
{
global $page_id ;

$page_on_front = get_option(‘page_on_front’) ;
$page_for_posts = get_option(‘page_for_posts’) ;

if ( $page_id == $nav_item[IDN] && $page_id == $page_on_front){
$is_current_page = true ;}

if ( $nav_item[IDN] == $page_for_posts && $page_id == $page_for_posts ){
$is_current_page = true ;}
}

After inserting this code block, go to the new line 263:

// Hack to fix static front page problem
$show_on_front = get_option('show_on_front') ;
if ($show_on_front == 'page' && get_option('page_on_front') && is_page(get_option('page_on_front')) )
{
global $page_id ;
$page_on_front = get_option('page_on_front') ;
$page_for_posts = get_option('page_for_posts') ;

if ( $nav_item[IDN] == HOMEIDN && $page_id == $page_on_front)
$is_current_page = true ;

if ( $nav_item[IDN] == $page_for_posts && $page_id == $page_for_posts )
$is_current_page = true ;
}

The main addition was in the inital if statement [if ($show_on_front == 'page' && get_option('page_on_front') && is_page(get_option('page_on_front')) )].

Good Luck!

 

2 Responses to “Word Press Navt Plugin for Static Homepage”

  1. dualtech Says:

    We are hoping for a fix to this same issue. The latest version of Navt (1.0.27) doesn’t seem to address this yet. Also, the link you referenced doesn’t load for me.

  2. Admin Says:

    It looks like the site has closed. I will try to find the post somewhere else. For now, the main issue with getting a static page to show as an active link for the home page. By adding the two items above in (app/navt_fe.php), fixed the issue for me.

    The fix was to run a check if the page you are on, was set as the static homepage from the backend admin. If it is, set it as active page. If you add these two sections, it should fix your issue. I didn’t add anything else.

Leave a Reply

You must be logged in to post a comment.