Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar not working with my code #68

Open
benfiratkaya opened this issue Aug 20, 2019 · 1 comment
Open

Sidebar not working with my code #68

benfiratkaya opened this issue Aug 20, 2019 · 1 comment

Comments

@benfiratkaya
Copy link

benfiratkaya commented Aug 20, 2019

Hello i use this code in functions.php

  function benfiratkaya_add_search_form($items, $args) {
    if ($args->theme_location == 'primary') {
      $searchForm = get_search_form(false);
      $items      .= $searchForm;
      return $items;
    }
  }
  add_filter('wp_nav_menu_items', 'benfiratkaya_add_search_form', 10, 2);

if use this code not showing sidebar menu items.

@benfiratkaya
Copy link
Author

I fixed with this code:

  function benfiratkaya_add_search_form($items, $args) {
    if ($args->theme_location == 'primary' && !is_better_amp()) {
      $searchForm = get_search_form(false);
      $items      .= $searchForm;
    }
    return $items;
  }
  add_filter('wp_nav_menu_items', 'benfiratkaya_add_search_form', 10, 2);

i checking with 'is_better_amp()' function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant