Jump to content


Photo
Poppy

Poppy as Menu item?

poppy

Best Answer Simon_P , 01 October 2013 - 09:58 PM

Add to pagelines-customize functions.php/child theme functions.php....

 

function be_menu_extras($menu, $args) {
$extras = do_shortcode( '<li class="menu-item menu-item-type-custom menu-item-object-custom">[poppy type="a"]Contact[/poppy]</li>' );
return $menu . $extras;
}
add_filter('wp_nav_menu_items','be_menu_extras', 10, 2);
Go to the full post


  • Please log in to reply
3 replies to this topic

#1 julius

julius

    Advanced Member

  • Members
  • 45 posts
  • LocationItaly (Bolzano)
  • Framework Version:DMS
  • Country: Country Flag

Posted 01 October 2013 - 09:46 PM

Love the free section "Poppy" with contact shortcodes :)

 

Can anybody tell how I can put it in a regular menu?

For example I have a "Contact" menu item in footer and would like to open the Poppy form when clicked -

how do I get that?



#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 01 October 2013 - 09:58 PM   Best Answer

Add to pagelines-customize functions.php/child theme functions.php....

 

function be_menu_extras($menu, $args) {
$extras = do_shortcode( '<li class="menu-item menu-item-type-custom menu-item-object-custom">[poppy type="a"]Contact[/poppy]</li>' );
return $menu . $extras;
}
add_filter('wp_nav_menu_items','be_menu_extras', 10, 2);

  • Jenny, CliffordP, julius and 1 other like this

#3 ahansson89

ahansson89

    Advocate

  • Members

  • 522 posts
  • Framework Version:DMS
  • Country: Country Flag

Posted 06 October 2013 - 12:57 AM

Is it possible to only add it to the Fixed Navbar area?



#4 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 07 October 2013 - 05:27 PM

I thinks the name of the menu is passed in the second var $args, use plprint/var_dump or something to print it out, then use some logic.







Also tagged with one or more of these keywords: Poppy, poppy