You are here: Pixo Point Support Forum » General Category » Menus » Home page and blog page BOTH marked active when a static page is set as homepage

Author Topic: Home page and blog page BOTH marked active when a static page is set as homepage  (Read 1366 times)

nv1962

  • Premium Support
  • Jr. Member
  • *
  • Posts: 89
  • Reply with quote
Hi,

I suppose this is an oldie, but I'm still trying to figure out why it happens, and what (if anything at all) I could do to address / avoid this.

Here's the issue:

If you have marked a static page as your frontpage (Settings > Reading) and regardless of whether you also have set some other page as your posts page, in the menu both the homepage link AND the blogpage link are shown as "active" (highlighted) when you visit the page set as the blogpage (posts page). Anywhere else, the menu correctly shows the top-level parent of the page you're visiting as the active (highlighted) one.

It drives me nuts: I have tried all sorts of subterfuge - including the use of "phony" pages that actually redirect to the "real" homepage or blogpage (using e.g. the Page Links To plugin) - no dice, visiting the blogpage causes both the homepage and blogpage links in the menu to be highlighted.

Now, I've seen a few themes with built-in i.e. custom menus (elsewhere) whose authors make a point of indicating that they're "specially designed" to deal with WP installs with a non-post page set as the frontpage, but I fail to understand what makes those work, or what it is that they have done.

So, um... Am I just the only one with this weird issue? Have I overlooked some more or less obvious thing that I actually should have addressed in the theme? Or is it something in the menu code (PHP or CSS) that I need to tweak?

To get an idea of what I mean, you can see the double menu highlighting issue on this page here (that page is marked as the blogpage or Posts Page in Settings > Reading) and compare the menu appearance on that one to the non-highlighted menu (at all) on the homepage of the same site. Note: I have also tried to include (in Settings > PixoPoint Menu > Home) a link to the "real" page which I set as the homepage, but that doesn't make any difference.

Hopefully I'm just a dunce as usual, overlooking one nifty option or another, because it just baffles me!
« Last Edit: October 09, 2009, 03:28:14 PM by nv1962 »
Logged

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
Hmmm, this will be related to how the is_front_page and is_home functions are used in the plugin. This should be fixable - I'll put on my ever growing list of stuff to do.

I'm working furiously at the moment, updating the plugin and essentially rewriting most of it from scratch so when I get to that section of the plugin I'll see if I can fix that problem for you.

Back when that code was written for the plugin there was no is_front_page() function in WordPress so there would have been no real way for me to add this functionality into the plugin without a lot convoluted code. It should be a lot easier now though.
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
FYI, is_home() does not detect the presence of the home page, hence the confusion.
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

nv1962

  • Premium Support
  • Jr. Member
  • *
  • Posts: 89
  • Reply with quote
I'm working furiously at the moment, updating the plugin and essentially rewriting most of it from scratch

Yikes! That's a gargantuan task.

The "double highlight" issue is a bit odd, but in no way approximating a show-stopper. I posted the inquiry here merely to see if it's something I could "easily" fix - but from what you're explaining, it's just the way the WP core functions and hooks have been.

Good luck with that enormous project. I'll be eagerly awaiting your news!

Oh - please let me know if/when you need the localization updated again; I've ditched my Spanish-language blog, so I'm not tracking localization directly as I used to. I have a staging server with Spanish WP lingering, so I can get to it whenever you need or like, just drop me a line.

And, as always: thanks so much for keeping your awesome PixoPoint Menu plugin up-to-date, it's quite impressive as it is.
Logged

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
Yep, it is a gigantuan task. However it's something which has slowly evolved over time and there was simply too much legacy code lingering around. I also realised after releasing the PixoPoint Menu plugin that I should have done the editing panel in an entirely different way. It's too buggy, too prone to errors and takes way too long to load. The new system will be lightening quick in comparison, ie: when you click submit it should redesign the menu a split second after you click it, with no need to wait for the page to reload.

It will also run somewhat quicker. There is some odd-ball servers out there which for whatever reason have extraordinary trouble loading the javascript and CSS files in the plugin, like up to 10 - 15 seconds which is insanely long for a file of only a few kilobytes (most servers load in a matter of milli-seconds, it's just the occasional odd-ball which doesn't), so I'll be reengineering it to fix those problems too.

The new system will also put a lot less strain on my own server as if the existing plugin became super popular it would start causing problems for my hosting setup. The new system will be much less resource intensive for me (this doesn't affect end-users though).

I'd definitely appreciate a Spanish translation of the PixoPoint Menu plugin (I don't have one yet, just the Multi-level navigation plugin). But best to wait till the new version is released as there's bound to be plenty of changes beforehand.

I'll also be writing an upgrader so that users can more easily migrate from Multi-level navigation over to the PixoPoint menu plugin and the mulit-level-navigation plugin will be placed aside and I'll be recommend users upgrade to the new plugin ... once I confirm that everything is working properly and it's been thoroughly tested on a variety of different sites.
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

nv1962

  • Premium Support
  • Jr. Member
  • *
  • Posts: 89
  • Reply with quote
FYI, is_home() does not detect the presence of the home page, hence the confusion.
Bingo! You're right - I just now (yeah... groan) figured out that when one has a blog set up with a static homepage (i.e. my case) the call to make is not is_home() but is_front_page() instead.

So... um... you think you could point me to the location within your plugin to modify the conditional look, so as to do a dual check for e.g. !is_home() && !is_front_page() to get rid of that?
Logged

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
I'll fix it for you and upload a new version.

I'll try to get it done within the next day or so. If I don't, feel free to bug me about it as it's clearly an annoying feature which I need to correct.
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

nv1962

  • Premium Support
  • Jr. Member
  • *
  • Posts: 89
  • Reply with quote
*cough*



Happy Holidays! ;)
Logged

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
Thanks for the cough! Working on this right now for you.

Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
New version is attached.

I haven't been able to upload it to the official repository right now as I'm sending this via a public library which doesn't seem to allow me to use Tortoise SVN (program I use to update the repository).
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.

nv1962

  • Premium Support
  • Jr. Member
  • *
  • Posts: 89
  • Reply with quote
YAY!!!

Thank you so much for solving that one... Much better! All happy now.

And um, working that miracle from a public library? Makes it even more totally awesome.

Thanks again!
Logged

Ryan

  • Administrator
  • Hero Member
  • *****
  • Posts: 3180
    • WWW
  • Reply with quote
I was in transit from Hobart to Wellington via Christchurch. I'm now working out of the public library in Wellington :) I find libraries much more pleasant to work in than cafe's :)
Logged
Available for paid work. Either sign up for Premium Support or use our Contact Page for more information.
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Note: this post will not display until it's been approved by a moderator.
After submitting your post you will be directed to the regular post page to verify your post (required for all guests).
Name: Email:

Powered by SMF 2.0 RC1 | SMF © 2006–2009, Simple Machines LLC | DSv4 Design by DzinerStudio