• Resolved Halil ESEN

    (@halilesen)


    Hi Ben, happy holidays!

    There are changes he wants to make regarding the menus and I would like to get your help.

    I have 3 software belonging to my site. The first of these is WordPress and on the main domain, the second is a WordPress in the subfolder, and the third is the phpBB forum. I want all of these to be signed up with a single membership.

    The first is about the mobile menu. I want to move the menu icon to the right and replace the search icon with a user avatar. Of course, I’m not going to ask you to do anything related to the user avatar here. What’s more I would like to have a search bar above the links to the open menu.

    Here is a demo: https://i.hizliresim.com/bi0j1cw.jpg.

    I thought I could do this myself, but I couldn’t find where to edit the menus. Later I realized that it might be more complicated than it seems.

    Another has to do with the desktop menu. If you remember, you once say that it look different with the menu on the forum. True and now I want to equalize the terms:

    I want to add a user login and panel to the far right of the menu. Then I want to give a scrolling shape to the menu links.

    Here is a demo: https://i.hizliresim.com/dhu3nl8.jpg .

    I’m thinking of preparing a menu or bar that will appear when you click on the avatar in the avatar section in the second part. For this reason, it will be sufficient to have only an avatar in the WordPress section.

    Also, do you have any idea about the topic I opened here?

    By the way, let me tell you something very strange. I wanted to make a theme change. But it is very difficult to give up on the MS theme; I love its. I will use it for a while longer.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hey Halil,

    Welcome back haha ??

    To add the search bar, you’ll want to include it in the menu-primary.php file. You can add it right before the “#menu-primary” element. There’s also a get_search_form() function you can use to output a search form there. It will need a lot of styling, but the HTML and functionality will work right away.

    For the Login menu item, you could add that inside the #menu-primary div in the menu-primary.php menu. Use the is_logged_in() function to either output a “Login” button or the user’s avatar, which you can get with get_avatar(). As for the horizontal scrolling, that is more complex than it sounds, but you can try a technique like this: https://css-tricks.com/pure-css-horizontal-scrolling/

    I’m not sure how to integrate user accounts between WordPress and phpBB. It looks like there are some plugins that can help, but they haven’t been updated in many years. You could migrate from phpBB to bbPress, which is natively integrated with WP, and then all of your users would be saved in one place.

    Thread Starter Halil ESEN

    (@halilesen)

    Thank you for your help. I can make these theme changes as I want.

    I also want to add the dropdown on mobile to the phpBB section. But how can I get the correct codes?

    Theme Author Ben Sibley

    (@bensibley)

    I’m afraid I don’t have any easy way to share the code for that. I would recommend copying the HTML structure to start. The Javascript is pretty simple as it just opens and closes the menu, and if you don’t have submenus it will be much simpler. I’d also recommend checking out the menu styles here: https://github.com/BenSibley/Mission/blob/master/sass/_menu.scss

    That is written in SASS, which is compiled into CSS. The syntax is almost identical, so it should be pretty intuitive to read even if you haven’t written SASS before. It is way cleaner and more organized than the style.css file in MN, which isn’t made to be read by humans.

    Thread Starter Halil ESEN

    (@halilesen)

    OK. I feel like it’s going to get complicated. I can be content with the similarity of the menu on the desktop.

    For now, this topic is settled. Thanks a lot for your help. ??

    Theme Author Ben Sibley

    (@bensibley)

    Sure thing, glad I could help out ??

    Thread Starter Halil ESEN

    (@halilesen)

    Hello again Ben. I want to set a dropdown to the avatar in the menu. I used the codes here. But it didn’t work. No display; I don’t understand if css is interfering or JS is not working. Link.

    Theme Author Ben Sibley

    (@bensibley)

    Hey,

    I can’t know for certain what’s happening without seeing your version of the JS, but I have a couple of ideas you could look into.

    First, the avatar button is a link element, so you’ll want to change that to a button element or add this JS to prevent it from opening its URL:

    e.preventDefault();

    And second, the link element doesn’t have its own ID, so your JS may not be targeting it properly. Give the link a unique ID and then use that to fire the JS when it’s clicked.

    Thread Starter Halil ESEN

    (@halilesen)

    Sorry for replying so late.

    I found the cause of the error. By the way, the link I gave doesn’t work because the avatar will only be visible to logged in users. The reason for the error is that I call the avatar with php, and the code treats it as if it doesn’t exist.

    <?php global $current_user; get_currentuserinfo(); echo get_avatar( $current_user->ID, 36 ); ?>

    Actually there is an avatar, I can css edit it. but it does not detect its existence as code. If I put a dot instead it works.

    do you have an idea?

    Theme Author Ben Sibley

    (@bensibley)

    Yea you can use the is_user_logged_in() function to check if they’re logged in already:

    if (is_user_logged_in()) {
      // output the avatar
    }
    • This reply was modified 2 years, 2 months ago by Ben Sibley.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘I Want So Many Things Again: Menus…’ is closed to new replies.