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!