• Resolved wpress2010

    (@wpress2010)


    New client has an older theme. It lacks a lot of pretty standard features, but for now I have to work with it. I have managed to fix most of the issues via various PHP files, but the current navigation is very awkward. The “home” page is just “latest posts” – which means all 12 or so of them. I can easily set up a Custom Link to add a menu item for the Home page – which is just the root of the site: https://mysite.com

    However, this presents a small problem with styling the nav menu. The current configuration on all pages except Home, is that the menu item of the active page is specified as: [aria-current] – which means it’s simple to make any active page’s menu text display a different color, such as:

    [aria-current] {
    color:red
    }

    But the Home page, being a Custom Link menu item, just shows as:
    <li id=”menu-item-231″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-231″>Home

    That is, since it is just a link as opposed to a Page, there is no way to make it reflect the fact that it is active. No way to selectively style this link that I can see.

    The Block Editor on this site lacks the Blog Posts block, so even if I create a new Home page, I can’t see any way to add all of the posts (not a list, but the entire posts) to it.

    Anyone have a suggestion as to how to modify this Home page problem?

    TIA!

Viewing 1 replies (of 1 total)
  • Thread Starter wpress2010

    (@wpress2010)

    Solved: without too much extra work, I just decided to use the home page class to style the link, avoiding the whole “active” issue:

    body.home li#menu-item-231 a {
    color:red !important

    It’s difficult sometimes when taking over a site that hasn’t been touched in a long time, to make a few significant changes without having to essentially rewrite the whole thing. It would be nice to be able to add a custom class or id to a Custom Link menu item in the WP menu system.

    • This reply was modified 2 years, 2 months ago by wpress2010. Reason: typo
Viewing 1 replies (of 1 total)
  • The topic ‘Best way to setup Home page for all posts’ is closed to new replies.