Comments (5)
@jsbls you could override the end_lvl
method and append your widget before the closing tag for the menu. Let me know if that works.
See: https://codex.wordpress.org/Class_Reference/Walker#Abstract_Methods
from yamm-nav-walker.
Ok, let me give it a try right now. Thanks!
EDIT:
So the following happens. If I add plain HTML, it renders correctly, but PHP gets placed before the <ul class="yamm">
wrapper. For example:
public function end_lvl( &$output, $depth = 0, $args = array() )
{
$output .= ($depth == 0) ?
"\n<div>Hello, world</div>\n" .
"\n</div>\n" . // .row
"\n</div>\n" . // yamm-content
"\n</ul>\n" // .dropdown-menu
: "\n</ul>\n"; // else .subcat-ul
}
renders (I'm ignoring the else statement)
<ul class='dropdown-menu'>
<div class='yamm-content'>
<div class='row'>
<div>Hello, world</div>
</div>
</div>
</ul>
But
public function end_lvl( &$output, $depth = 0, $args = array() )
{
$output .= ($depth == 0) ?
"\n" . dynamic_sidebar('sidebar-featured-shop') . "\n" .
"\n</div>\n" . // .row
"\n</div>\n" . // yamm-content
"\n</ul>\n" // .dropdown-menu
: "\n</ul>\n"; // else .subcat-ul
}
...renders
<div class="sidebar-featured">(Sidebar content)</div>
<ul class="nav navbar-nav>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="//localhost:3000/shop/">Shop <b class="caret"></b></a>
<ul class="dropdown-menu">
<div class="yamm-content">
...
</div>
</ul>
</li>
</ul>
from yamm-nav-walker.
@jsbls sorry I went offline there for a while. Did you end up resolving this?
from yamm-nav-walker.
I can't remember! 😅 Let me go through the project and let you know. I think in the end what I did was add an Ads Plugin and insert the shortcode, but I'm not sure. Will update soon.
from yamm-nav-walker.
haha no problem! Just wanted to check in. Felt bad I left you hanging lol
from yamm-nav-walker.
Related Issues (7)
- Does not apply to strict standards HOT 3
- How do I make it so that it supports images HOT 4
- Column Counts HOT 2
- Container Issue HOT 4
- Apply all menus in wordpress HOT 3
- Is compatible with bootstrap 4? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yamm-nav-walker.