• Resolved lexi889

    (@lexi889)


    Hello,

    i added the line to my css-file:
    .widget_subpages_current_page a {
    font-weight: bold;
    }
    and this works.

    The Problem is, if a subpage has another subpage, they both are shown bold.
    e.g.

    -Main1.1
    -Main1.2
    -Main1.3 (selected)
    –Main1.3.1

    and

    -Main1.1
    -Main1.2
    -Main1.3
    –Main1.3.1 (selected)

    In the first example i want only the selected page to be highlighted.
    The second one works fine.

    I use wordpress Version 4.0.1 and the plugin Version 1.5

    Thanks for your help.
    (sorry for my english)

    https://www.ads-software.com/plugins/be-subpages-widget/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Update your CSS to use this selector:

    .widget_subpages_current_page > a

    The “>” indicates that the styling should only apply to the direct descendent.

    Thread Starter lexi889

    (@lexi889)

    Thanks.
    works perfect.

    But i have another question.
    Is there a way to also highlight the current section when using a custom menu?
    The subpages are not included in the custom menu and it works if i select the section in the menu. If i select a subpage it doesn’t.

    Thanks for your help.

    Thread Starter lexi889

    (@lexi889)

    Is it also possible to make it look like this:

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

    Thread Starter lexi889

    (@lexi889)

    Found the solution for my last Problem:

    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;
    }

    I know that this will be reseted when updating the plugin.

    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.

    Thread Starter lexi889

    (@lexi889)

    One question open:

    But i have another question.
    Is there a way to also highlight the current section when using a custom menu?
    The subpages are not included in the custom menu and it works if i select the section in the menu. If i select a subpage it doesn’t.

    Thanks for your help.

    Plugin Author Bill Erickson

    (@billerickson)

    Look at the classes applied to the menu items in the custom menu. Typically there’s something like .current_page_parent or .current-page-ancestor that you can use to style

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Highlighting current page but not it's subpages’ is closed to new replies.