1

I decided to try my hand at creating my own WP theme from scratch. I've made a header, a navbar, and a footer so far. I've also registered a couple menus, so my navbar will be populated automatically via whatever an end user will make with the WP UI.

However, my footer came out quite large and has 4 lists in it: 3 columns for whatever info you want to put in them, and another list for social links. I'm not sure how to handle that exactly, since I'm not very familiar with how WP menus work, but I've registered all 4 of these as separate menus like so:

function theme_menus()
{
    $locations = array(
        "primary" => "Desktop Primary Left Sidebar",
        "footer_1" => "Footer Menu Items, First Column",
        "footer_2" => "Footer Menu Items, Second Column",
        "footer_3" => "Footer Menu Items, Third Column",
        "footer_socials" => "Footer Menu Items, Social Links",
    );
    register_nav_menus($locations);
}

add_action("init", "theme_menus");

Is this good or bad? Would it be considered good practice to have a singular menu for all of these?

1
  • I found more useful to have separate locations. this allows to decide which responsive effects append for smaller screens.
    – mmm
    Commented Jun 30 at 14:38

1 Answer 1

0

In my opinion your approach of registering multiple menus for different footer sections and social links is a good practice in WP theme development because it provides more flexibility and clarity to users in managing their site content and also allows easier customization and maintenance in the long run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.