skip to Main Content
Our free WordPress themes are downloaded over 3 MILLION times. Get them now!

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Update to 2.0.8 broke my child themed site #261132
    tmgdesigns
    Participant

    Thanks for responding. Unfortunately, setting up a clone will be a bit of a hassle. The hosting plan for the site is bare bones with no staging site included and no room for another database/wordpress install. I will have to find space somewhere else and port everything over. I will do this at some point- hopefully I will have some time soon. I know I can’t work this out on the live site as it completely falls apart with the update. Thanks for your offer to try and help- I hope to be able to take you up on it soon. I will post here when I have something set up. I also hope you might consider a more detailed changelog in the future…

    Thanks again.

    in reply to: Header and menu broken after update to 2.3.5 #115297
    tmgdesigns
    Participant

    Then why does my child theme work perfectly before the update? And why would several people have exactly the same problem? Something in the update broke the menu. What changes did you make? Would you at least update the changelog on the Sparkling theme page (looks like the last update to the changelog was in 2015) so I can see what was changed that caused the problem? I have a very bare bones child theme with very few changes other than styles.css.

    in reply to: Need to close mobile menu on click for anchor links #85034
    tmgdesigns
    Participant

    Bug Fix- I didn’t account for dropdown menus. I changed the footer code to:

    
    jQuery(document).ready(function($) {
     $('.menu li a').click(function() {
            if ( ($(this).hasClass('menu-link-class')) && (!$(this).parent().hasClass('dropdown'))){
                $(this).closest('.nav-bar').removeClass('nav-open');
            }
        });
    });
    

    That seems to do the trick, though I’ve only been able to test the mobile actions on Android….

    • This reply was modified 3 years, 6 months ago by tmgdesigns.
    in reply to: Need to close mobile menu on click for anchor links #84745
    tmgdesigns
    Participant

    If you truly have only one page and all of your menu links start with #, the mobile menu will close on click, but if you have a one page style homepage and use separate pages for your portfolio or blog or individual items, you will have to make your links absolute ( http://mysite#about instead of just #about) so your menu will work from the inner pages as well. When you do this, the mobile menu will no longer close when clicked.

    I think I finally figured out a solution. First, make sure you are working with a child theme.
    Add the following code (from the WP Codex) to your functions.php file- this will add a class directly to the a element in the primary WordPress menu only:

    
    function add_specific_menu_location_atts( $atts, $item, $args ) {
        // check if the item is in the primary menu
        if( $args->theme_location == 'primary' ) {
          // add the desired attributes:
          $atts['class'] = 'menu-link-class';
        }
        return $atts;
    }
    add_filter( 'nav_menu_link_attributes', 'add_specific_menu_location_atts', 10, 3 );  
    

    Then add the following code to your footer.php file:

    
    jQuery(document).ready(function($) {
     $('.menu li a').click(function() {
            if ($(this).hasClass('menu-link-class')){
                $(this).closest('.nav-bar').removeClass('nav-open');
            }
        });
    });
    

    You can change ‘menu-link-class’ to whatever you want – just make sure it is the same in both bits of code.
    The menu will now close when clicked in a mobile device.

    • This reply was modified 3 years, 6 months ago by tmgdesigns.
    in reply to: Need to close mobile menu on click for anchor links #84702
    tmgdesigns
    Participant

    Thanks for the response, but I’m really sorry you feel that way and I beg to disagree. Shapely specifically lists itself as a one page theme, and it would be a terrific choice for that except for this bug. It seems to me that it’s a much more universal issue than just something custom for my site. Every user who tries to use Shapely for a one page site will have this same problem- having your menu block your content on a mobile device is big problem. Unfortunately, Since Shapely specifically advertises itself as a one-pager, I made the assumption that basic issues like this would be dealt with and I am now too far into my site build to change themes without a huge hassle. I will have to try and figure this out somehow and would have really appreciated your help.

Viewing 5 posts - 1 through 5 (of 5 total)
Disclosure: This page contains external affiliate links that may result in us receiving a commission if you choose to purchase mentioned product. The opinions on this page are our own and we don't receive additional bonus for positive reviews.
Back To Top