Drop-Down Menus Begone!

HAPPY BIRTHDAY TO ME !!! 🙂

My drop-down menus, which I added last year, were starting to REALLY annoy me and get in the way:

So I have re-done my page and gotten rid of them:

Instead, when you click on a menu item like RIVER, you get a new page with square photos, one for each category [River Critters, 2010 Flood, & 2006 Flood].  Hover your mouse over each square to see the category names, then click:

        

And you’ll be brought to that page:

Here’s what the ART & HOUSE pages look like:

        

I also split out my ART page into Stained Glass Art & Painting Art *nods*.

And the PETS & PROJECTS pages:

        

I hope you enjoy my new pages as much I do!

I also made a couple more tweaks for 2017.  One was to change my Next Post/Previous Post links to “NEXT” & “PREVIOUS” instead of showing the blog titles.  I think this way is neater and easier to follow.  They are at the very top and very bottom of each post:

The hardest thing I did was figure out how to make the BLOG menu highlight red when a blog post is being read [my other menu items already do that].  It involved some fancy PHP code which I found, tweaked to suit my own needs, and embedded into my theme’s child “function.php” file.  Since WordPress considers the BLOG/HOME page to be your website’s actual main page, and not a sub page like RIVER or ART, it doesn’t behave like a regular page, and therefore can’t be manipulated like a regular page.  But I figured it out, and I’m very happy!!!:

Here’s the code if you’re interested [many thanks to Johannes Bader] – you just have to use FireBug to figure out the menu-item-id of your BLOG/HOME page [mine’s 58] and tweak it for your own needs:

function add_custom_class($classes=array(), $menu_item=false) {
   if ( !is_page() && 58 == $menu_item->ID &&
   !in_array( 'current-menu-item', $classes ) ) {
   $classes[] = 'current-menu-item';
   }
return $classes;
}
add_filter('nav_menu_css_class', 'add_custom_class', 100, 2);
(Visited 57 times, 1 visits today)

10 Comments

  1. Happy birthday! The blog pages look great. I am so proud of you for being able to make coding changes. I tried once and made such a royal mess that I have been terrified to attempt it ever since.

    • Thanks, Jessica! It’s a LOT of trial & error! I broke my page about 20 times trying to get the new code to work! I had to login via the GoDaddy/FTP side of things to fix it back. Many tense moments for sure.

  2. Nice improvement! I went back and looked at your river flood pix again and was just as horrified as the first time I saw them! 🙂 Happy birthday!! I hope you have a wonderful day!

    • Thanks, D’Arcy! Yeah, I’m pretty glad I didn’t move in until 2011… So far been lucky in the flood department!

  3. ps HAPPY BIRTHDAY!

  4. Thank God I only have to deal with GoDaddy for my Website. Luv, Dad

    • I have GoDaddy too 🙂 I love the flexibility offered by WordPress themes. I am glad most allow you to tweak the css and php coding behind the scenes.

  5. omg – that fancy coding is SO beyond my comprehension.
    However, all your improvements are good ones and definitely helpful.
    Very impressive, as always.

Leave a Reply