Computer screen with the Giornalismo homepage

Getting to the fun part of coding

,

So the long battle with JavaScript has finally ended after a few weeks.

The last part of the mobile version for Giornalismo that I wanted to add involved a main menu that the user could swipe horizontally to see the items. For this, I used Swiper from iDangerous, which is incredibly useful by the way, that I used on the mobile homepage for Nuovo and used extensively for the mobile version of the Arena Pigskin site I used to have.

However, until now I had never used the Swiper for anything other than a normal div element. To implement it into the menu, I would have to navigate through the list tags, like ul and li, and figure out how to get what the Swiper needed into it.

The first thing I needed to do was create a new Walker Nav Menu, which to keep it short allowed me to add the swiper-slide class into each top-level item. Then using the wp_nav_menu() function, wrapped it all in div class of swiper-container and then add the swiper-wrapper class to the ul tag. Even then I wasn’t still quite done. There was a lot of fiddling and messing around that had to be done, but I managed to get it all taken care of, even though it still isn’t perfect.

The issue I still have is dealing with overflow. Since the wrapper, which contains all of the top-level items, extends off the page technically, the swiper-container has to have an overflow: hidden attribute; however, the sub-menus of the items that have child elements has to overflow vertically to be shown. And because CSS is so fickle, there’s no way to hide the horizontal overflow and show the vertical overflow. So the “hack” I’ve devised is that overflow is hidden in the normal state and shown on hover, which gets the goal of showing the vertical stuff, but does extend the page horizontally on hover, but I’m not too worried about that now. Maybe CSS will fix that issue in the future.

Now finally moving on with Giornalismo, I’m starting to add special features for the theme, starting with advertisements. This feature will have a custom post type, aptly named “Advertisement,” and the user will be able to chose if advertisements are shown in the header and what advertisement category is shown. There will also be a widget that will show advertisements from a category. Hopefully these will be implemented by Jan. 9.

As for Nuovo, it came back a couple of weeks ago with bad news with stuff that still needs fixing and there’s good news and bad news on that front. First, everything that needed to be fixed has now been fixed. The bad news is that because I didn’t respond within a week, the ticket for the theme was closed and now I have to go through the process from the start all over again. But considering it’s already been reviewed twice, this should be relatively easy once someone reviews it first.

So that’s sort of an update on where things stand at the moment. Merry Christmas to you all!

Keep Learning with the Small Business Websites Newsletter

There’s a lot to learn when it comes to websites. How do you build a website that’s going to help your business grow? How do you manage a website to help your business grow? What’s the latest website news that you should know about? What are some websites you can look to for inspiration?

The Small Business Websites Newsletter helps you answer each of these questions. The biweekly newsletter will take a deep dive into some website-related topic, like SEO, WordPress, how to plan a website and more, to help you learn more about websites. I’ll also include some website news that you should know about as well as add inspiration I’ve found that might help you. And you’ll even get discounts for various products I offer. And all of this is for free.

So if you want to be better at building or managing your small business website (or any website for that matter), then you’ll want to sign up today!

"*" indicates required fields

Name*
GDPR Compliance*
This field is for validation purposes and should be left unchanged.