Topic Resolution: Resolved
  • Closed
  • June 8, 2015 at 6:47 pm #17981

    Hi, to change the background color of selected item and hover of the main menu, I use this code, which works fine, when I insert it in theme option –> Custom css:

    ul.nav-menu li.current-menu-item:before, ul.nav-menu li.current-menu-ancestor:before,ul.nav-menu li.current-menu-ancestor li.current-menu-item a, ul.nav-menu li.current-menu-ancestor li.current-menu-parent a,ul.nav-menu li.current-menu-item, ul.nav-menu li.current-menu-ancestor, ul.nav-menu li:hover {background:grey!important;}

    Since I included all my css changes in the style.css of my child theme, I inserted the code in there, but it does not work. It seems, that the mark !important does not work in this case, but however… any hints are welcome.

    Thank you, Frank

    Denzel Chia
    Moderator
    Posts: 2672
    June 9, 2015 at 2:57 am #17987

    Hi,

    I cannot be sure what happened. I think it has to do with the loading sequence of the css files.
    I will need to take a look.

    Please kindly provide the following details via private reply.

    WordPress Login Url:
    Username:
    Password:

    Ftp Server Url:
    Port:
    Username:
    Password:

    (Note: To make a private reply -> Click on the “Set as private reply” check box found at lower left corner of this forum’s text box before clicking on Submit button. This will ensure that your reply is visible only to Moderator and Keymaster)

    Thanks!
    Denzel

    Frank Stellmacher
    Spectator
    Posts: 18
    June 9, 2015 at 11:50 am #17994
    This reply has been marked as private.
    Denzel Chia
    Moderator
    Posts: 2672
    June 10, 2015 at 6:54 am #18009

    Hi,

    There is a line of code in custom-css.php at line 492, which is overwriting your css in child theme’s style.css
    This line of code has the !important mark.
    The custom-css.php is loaded after style.css, so there is no way to overwrite it unless we use a function in child theme.

    I added the following codes in your child theme’s functions.php

    <?php
    function np_hook_css(){
    ?>
    <style type='text/css'>ul.nav-menu li.current-menu-item:before, ul.nav-menu li.current-menu-ancestor:before,ul.nav-menu li.current-menu-ancestor li.current-menu-item a, ul.nav-menu li.current-menu-ancestor li.current-menu-parent a,ul.nav-menu li.current-menu-item, ul.nav-menu li.current-menu-ancestor, ul.nav-menu li:hover {background:grey !important;}</style>
    <?php
    }
    add_action('wp_head','np_hook_css',99);

    ?>

    This will print the above style code after custom-css.php and in HTML head.
    This is the only way to keep this style code working in child theme.

    Please see screenshot, your menu is working properly now. http://prntscr.com/7f8p99

    As for your additional issues.

    I do not understand issue 1.

    For issue 2, I found a plugin called TemplatesNext ToolKit in your plugins folder.
    I go into it templatesnext-toolkit -> inc -> widgets -> widget-image.php line 77, found the following codes.

    $output .= '<a href="'.$image_1_url.'" target="_blank">';

    Change to the following.

    $output .= '<a href="'.$image_1_url.'" target="_self">';

    Please note that your additional issues are not part of our product and I am doing it out of goodwill.
    Sorry, I cannot be providing anymore support for issues not related to our products.

    Thanks!
    Denzel

    Frank Stellmacher
    Spectator
    Posts: 18
    June 10, 2015 at 8:09 am #18016

    Thank you Denzel, problem is solved. Regards, Frank