BuSo Lightning - Official Support Thread

Stephen

Ecommerce SEO / SEM
BuSo Pro
Joined
Jan 21, 2015
Messages
222
Likes
118
Degree
1
Hi All.

I've used this theme in the past without many modifications. I'm thinking (please correct me) that if this is a truely minimal Wordpress theme and I am happy with it at this stage, I could ask my dev to use this as a Child Theme to make the customisations I want. Is that possible?
 

Ryuzaki

女性以上のお金
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
3,406
Likes
6,212
Degree
7
@Stephen, Correct. You could do it as a child theme or edit the theme itself at this point (go child theme though). There's no updates being pushed out or any way to auto-update anyways. It's in it's final stage, where everything that needs to be there is there, and anything extra is up to you to add.

The only update that might come in the future is entirely based on what Wordpress does with Gutenberg and how the CSS plays out with their "blocks" or whatever they're calling them. Even then, you'd have to add the update yourself, which will likely just be additional CSS you could add at the bottom of the current CSS file.

Child theme is the most future-proof method of adding onto it.
 

mikey3times

BuSo Pro
Joined
Aug 25, 2018
Messages
72
Likes
56
Degree
0
I’m not sure if this is a problem with the theme, but Wordpress doesn’t enqueue jquery or jquery-migrate when I switch to BuSo Lightning. My other themes don’t have this issue. I can’t find anything in Lightning’s functions.php that is stopping them from loading.

I guess I can just have them loaded in the header, but I don’t want to have the extra code if it isn’t required.

I’m in WP5 if that makes a difference. I discovered it since the mobile menu isn’t working in any of my browsers across all devices and I get a console error that the menu.min.js can’t find a function named $.
 

Ryuzaki

女性以上のお金
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
3,406
Likes
6,212
Degree
7
@mikey3times, just hang tight. I'll investigate that when I address the rest of the changes that I need to make for WP 5.0. I may be able to start working on it within a few days if I manage to clear some work off the table, which seems likely.
 
Joined
Aug 2, 2017
Messages
64
Likes
40
Degree
0
That's because the script is not enqueued. It's on the footer.
Delete it from the footer and add this on fuctions.php
Code:
/**
 * Enqueue a script with jQuery as a dependency.
 */
function wpdocs_scripts_method() {
    wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/menu.min.js', array( 'jquery' ) );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_scripts_method' );
 

mikey3times

BuSo Pro
Joined
Aug 25, 2018
Messages
72
Likes
56
Degree
0
I did what @DarkRed suggested, but I still had to make the following change to the menu.js and menu.min.js files:

Code:
// For Mobile Menu Expansion
jQuery(document).ready(function($){
    $(".mobile-only").click(function(){
        if ($(".mobile-menu ul").hasClass("expanded")) {
            $(".mobile-menu ul.expanded").removeClass("expanded").slideUp(250);
            $(this).removeClass("open");
        } else {
            $(".mobile-menu ul").addClass("expanded").slideDown(250);
            $(this).addClass("open");
        }
    });
});
The key is in the first line, where you need to use jQuery instead of $ and then add a $ inside the function ().

I also added the following code to the stylesheets to make the the cursor into a hand on the mobile menu when viewed on desktop:

Code:
.mobile-menu {cursor: pointer;}
For what its worth, I think enqueuing the stylesheets is what should be done. I had to do that in my child's functions.php to make sure my child stylesheets get picked up. Again, I'm not a developer so I may be wrong.
 

Ryuzaki

女性以上のお金
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
3,406
Likes
6,212
Degree
7
For what its worth, I think enqueuing the stylesheets is what should be done. I had to do that in my child's functions.php to make sure my child stylesheets get picked up. Again, I'm not a developer so I may be wrong.
You're right and I've already added that to the update that I'll roll out ASAP. This was built before many people were using HTTP/2. Now that that's becoming fairly widespread, I'm going back to enqueueing for this theme as well as using some newer methods that'll make things even faster in regards to jQuery and other render blocking files that are forced on us with Wordpress.
 

Ryuzaki

女性以上のお金
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
3,406
Likes
6,212
Degree
7
I'm bumping this so people know it exists.

I just migrated a ton of old posts from the marketplace to this new thread and highjacked the opening post. I'll drop links to this thread in the marketplace thread too. Thanks for all the support, questions, and usage of the theme!
 

Ryuzaki

女性以上のお金
Staff member
BuSo Pro
Digital Strategist
Joined
Sep 3, 2014
Messages
3,406
Likes
6,212
Degree
7
@rsheng, Good catch. This is because Wordpress is now outputting the <title> tag through wp_head so we no longer need to do it manually and so SEO plugins can hijack it and overwrite them. Wordpress usually finds the "manual" title tag and strips it out, but that's not happening in this case since I've nested it within an if/else statement and added some extra magic to it.

I'll fix that up today and maybe make another change. Thanks for pointing that out.

All you need to do if you already have this installed is delete the following out of header.php:
Code:
<title><?php if ( is_front_page() ) : ?><?php bloginfo('name'); ?><?php else : ?><?php wp_title('| ', true, 'right'); ?><?php bloginfo('name'); ?><?php endif; ?></title>