• Hi, I was looking for some help with the WP default theme V1.1, I added a search form to the nav menu (PHP and CSS code Below) but the search bar is showing at the right side of the menu, and I wanted it to be in the middle, between the Blog Name and the Navigation Menu Links.

    Ej: MySiteName Search Bar Link1 Link2 Link3

    Apart from that I Wanted to implement a login form for buddypress users at the nav menu (Search bar Shows only to logged in users)

    Thanks for the help:

    PHP Code:

    function add_search_to_wp_menu ( $items, stdClass $args ) {

    if(is_user_logged_in()) {

    if( ‘primary’ === $args -> theme_location ) {

    $items .= ‘<li class=”menu-item menu-item-search”>’;
    $items .= ‘<form method=”get” class=”menu-search-form” action=”‘ . get_bloginfo(‘home’) . ‘/”><p><input class=”text_input” type=”text” value=”” name=”s” id=”s” onfocus=”if (this.value == \’\’) {this.value = \’\’;}” onblur=”if (this.value == \’\’) {this.value = \’\’;}” /></p></form>’;
    $items .= ”;
    }
    return $items;
    }
    }
    add_filter(‘wp_nav_menu_items’,’add_search_to_wp_menu’,10,2);

    CSS Code:

    .menu-search-form input#s.text_input {
    border-radius:0;
    width:450px;
    margin-right:15px;
    margin-left:10px;
    font-size:12px;
    -webkit-transition:all .3s ease-in-out;
    -moz-transition:all .3s ease-in-out;
    -ms-transition:all .3s ease-in-out;
    -o-transition:all .3s ease-in-out;
    outline:none;
    border:1px solid #DDD
    }

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi!
    What is the url of your site?

    Best!
    Steve

    Thread Starter alexjvr222

    (@alexjvr222)

    Hi, It’s under development right know do you need more explanation for the Idea or more code?

    Hi Alex,
    it’s pretty tricky to make suggestions in the blind for custom code… maybe if you decide to get it on a live server we would be able to give you another look?

    Best!
    Steve

    Thread Starter alexjvr222

    (@alexjvr222)

    Hi BabyFaceweb,

    Thanks for your interest, to tell you the truth, the site it’s live, sort of, the problem is that the server got damaged and my host provider its fixing the issue, it’s begin down since Sunday, It’ll be probably live in a day top Wednesday.

    URL: https://www.gravemuse.com

    when you land, you see the registration page, and the login form on the left, (I’d like to get rid of that, and put it on the Nav Bar for non logged users) and when you login you see the menu and the search bar at the right. which I’d like to put in the middle between the GraveMuse and the Menu buttons.

    Thanks.

    when it becomes live again I’ll drop you a line here ??

    Hi Alex,
    the page is currently white, and no code is coming through (as you suggested). [Moderator note: Please do not solicit private support again]

    [Advertisement redacted]

    Either way, happy to help… this is what we love to do! ??
    Best!
    Steve

    Thread Starter alexjvr222

    (@alexjvr222)

    Hi Steve.

    My site It’s live again.

    Thanks for the help again. ??

    Alex, the site is locked down for anyone who hasn’t registered. Since it’s an adult site, that makes sense… but probably not something we can share details about here on WP.org perhaps…?

    [Advertisement redacted]

    Maybe the moderators here have some thoughts or opinions?

    Best!
    Steve

    Thread Starter alexjvr222

    (@alexjvr222)

    Hi Steve,

    Later today I’ll contact you via your site, to see what we cab do to fix this issue. I dont mind sharing the code..

    Thanks

    cool…

    Steve

    Thread Starter alexjvr222

    (@alexjvr222)

    Hi Steve,

    I’ve drop you a message on your site.

    Thanks

    cool…thanks.
    see your response there.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Closing as the conversation apparently went offline. Please do not open threads if you’re going to use private support.

    We are not okay with this.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Search bar and Login on navigation menu’ is closed to new replies.