Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #16830

    It drives me crazy how WordPress assigns classes to ancestor pages, current pages, etc… It really would be nice if there was a plugin or mechanism to force classes to be applied.

    Anyways, I’m using Propulsion and have woocommerce installed. On the main category page, I’ve styled the proper classes for current-menu-parent classes, etc… And that works fine for menus which are generated that look like this:

    <li id=”menu-item-40″ class=”menu-item menu-item-type-post_type menu-item-object-page current-menu-item current_page_item menu-item-40″>Our Products

    The classes are being added and so it can be easily styled. However, it would appear that the “Category” listing is not even adding these classes to the HTML object.

    So the process of my store is:

    Main website –> shop page (which contains categories and has the proper classed) –> Products listing (WHICH DOES NOT ADD THE PROPER CLASSES TO THE HTML) –> Product page (which also works fine and has the classes assigned)

    The Category listing looks like this

    <li id=”menu-item-40″ class=”menu-item menu-item-type-post_type menu-item-object-page menu-item-40″>Our Products

    There is no current-menu-item current_page_item and cannot be styled. Any thoughts???????

    #93047

    Hi,

    You can add .archive.tax-product_cat, this is the body classes assigned on woocommerce category archive.

    Regards,

    Ismael

    #93048

    What would I add that to? I see that the tax-product_cat class is applied to the body tag as well as the archive class, but how can I use this to style the currently selected navigational element?

    #93049

    Actually it doesn’t help you because the body class affects all menu items. If the menu item itself doesn’t provide an unique class it’s hard to style it in a different way. I’d contact the woocommerce plugin devs and ask them to include a filter function for woocommerce menu items: http://support.woothemes.com

    #93050

    I’ve been back and forth with woocommerce and it’s been determined it’s an issue with the theme. I’ve got twenty eleven installed right now and the class “current_page_parent” is being applied to the product category as expected. http://www.tri-point.com/staging/product-category/durafelx/

    When it’s the Propulsion theme, this class is not part of the list as noted above. Any ideas?

    #93051

    I’m keeping up the Twenty Eleven theme for you to see that the current_page_parent is indeed being added to the category page class. Please let me know of a response as I’m waiting to hear back and solve this issue and can switch back to the propulsion theme.

    #93052

    Hi kork,

    I see what you mean in your example with Twenty Eleven. I’ve tagged both Kriesi and Dude on this to get their input on the issue.

    Regards,

    Devin

    #93053

    Hi!

    I asked Kriesi to look into it and to update the menu walker class.

    Regards,

    Peter

    #93054

    Thanks guys, it’s most appreciated!

    #93055

    Hey!

    Actually I am not sure what you mean since the link you provided serves a 404 page for me…

    Also the theme does use the wordpress default menu walker and should generate the same code as twenty 11

    Would you mind setting up the page once again so it doesnt serve a 404 so I can take a look?

    #93056

    Sorry, didn’t see this until now.

    You can see that there is no class applied to the active menu items

    http://www.tri-point.com/product-category/buckles/side-release-buckles/

    http://www.tri-point.com/product-category/buckles/side-release-buckles/stealth-side-squeeze-buckles/

    But the main category page and the product page does have the current class applied:

    http://www.tri-point.com/product-category/our-products/buckles/

    http://www.tri-point.com/product/stealth-side-squeeze-buckles/anti-break-male-stealth-stealth-warrior-buckle/

    TwentyEleven theme applies the classes to all of the pages above.

    Thanks!

    #93057

    Hi!

    I tagged this thread for Kriesi.

    Best regards,

    Peter

    #93058

    Any update of this?

    #93059

    Hi kork,

    None that I know of. I’ll see if I can get a word from Kriesi on the issue or if he can post here.

    Regards,

    Devin

    #93060

    Thanks Devin

    #93061

    Hi,

    Since your site is no longer available, I set everything up locally but I am not finding the problem you are describing http://i.imgur.com/OF27C.png .

    If you look at the url in the image its structure looks the same as the url you provided above as an example.

    The html of the menu item looks like

    <li id="menu-item-360" class="menu-item menu-item-type-taxonomy menu-item-object-product_cat current-menu-item menu-item-360"><a href="http://propulsion.wp.dev/product-category/wordpress-themes/">WordPress Themes</a>
    </li>

    Thanks,

    Nick

    #93062

    @Nick – The links are still working (as per a few posts above).

    http://www.tri-point.com/product-category/plastic-buckles/tensionlocks-ladderlocks/ does NOT contain the current-menu-item class on the active menu with propulsion as the theme, however, the twenty eleven theme does.

    #93063

    I’m not sure what version of Propulsion you are running but it appears as though this is working correctly now on the demo site which is running version 1.7 of the theme.

    The individual items are showing current_page_parent on the Shop page in the menu which can be used to correctly style the parent “shop” in the menu as active.

    However, even on the WooCommerce demo, when looking at a product category the Shop link does *not* get any class that would highlight it as a parent or current page item. If this is the behavior you are looking for it doesn’t look like its included into the plugin which we wouldn’t be able to modify directly.

    Regards,

    Devin

    #93064

    The demo site at: http://www.kriesi.at/themes/propulsion/product-category/blog-theme/ is not working properly.

    There is no current_page_parent class on the menu element on this category page. If you enable the twentyeleven theme, it works as expected.

    #93065

    I understand that there is not, however the demo themes from WooCommerce do not appear to have this function either which leads me to believe it is either designed this way by the plugin or is a bug within the plugin.

    See the tshirt category on the “Definition” theme from WooThemes here: http://demo2.woothemes.com/definition/product-category/tshirts/

    Regards,

    Devin

    #93066

    Well I think I’m about to give up. I was told specifically by woothemes after troubleshooting that:

    “This isn’t something specific to WooCommerce rather a side-effect of WordPress Menus and/or the theme you’re using.

    Active categories _should_ have the “current-menu-item” class applied to them. You can see this if you add a category to your main nav and visit it with the TwentyEleven theme.

    I can’t see a category in your sites navigation to check. Could you add one and activate TwentyEleven to see if there’s an issue in your theme.”

    I enabled the twentyeleven theme and it worked perfectly fine and all of the page types had the classes applied to navigational elements. Enable Propulsion and voila, it disappears again.

    #93067

    Seems we have each side pointing to the other :(

    If it was happening with a WooThemes theme designed for WooCommerce I’d say its a Propulsion issue but it may in fact be something we are both not seeing.

    I’ll tag this for Kriesi again as I believe has contacts with WooThemes and might be able to help bridge the gap on this.

    Regards,

    Devin

Viewing 22 posts - 1 through 22 (of 22 total)

The topic ‘current-menu-parent specific to woocommerce’ is closed to new replies.