Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello whoaloic, did you find a solution to this problem? I also really need to be able to add a class to the parent menu item of the current subpage. Any help would be much appreciated. Many thanks!

    edit in be-subpages-widget.php in line 129:

    if ( in_array( $subpage->ID, $parents ) )
         $class[] = 'widget_subpages_subpage_is_selected';

    and in style.css

    .widget_subpages_subpage_is_selected > a{
    font-weight: bold;
    }

    This will be reseted when updating the plugin.

    Looks like this:

    -Main1.1
    -Main1.2
    -Main1.3
    –Main1.3.1
    —Main1.3.1.1
    —Main1.3.1.2 (Selected)
    –Main1.3.2

    #Thought my previous post didn’t work

    Plugin Author Bill Erickson

    (@billerickson)

    Instead of modifying the plugin directly, use the built-in filter be_subpages_widget_class.

    In your theme or core functionality plugin, write a function that modifies the classes using that filter. You then don’t have to worry about losing your changes as new updates come out.

    Dear lexi889, apologies for my late response, that works perfectly, thank you so much!

    Bill, I would love to use the filter in my child theme’s functions.php instead so I needn’t remember to add the code every time I update the plugin but unfortunately I don’t know how as unfortunately my php / function-writing knowledge is VERY limited.

    But I’m more than happy with lexi889’s solution unless someone wants to write and provide the function here ??

    Once again many thanks for your help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add a class to parent page’ is closed to new replies.