Replies: 2 comments
-
Seems to be unrelated to TailPress, see: https://wordpress.stackexchange.com/a/199847 You could do the following based on the answer linked to above: class LTM_Menu_Walker extends Walker_Nav_Menu
{
public function end_el( &$output, $item, $depth = 0, $args = array() )
{
if (in_array('menu-item-has-children', $item->classes ?? [])) {
$output .= '<h1>TEST</h1></li>';
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm happy this has nothing to do with TailPress - and the solution you've provided works perfectly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not sure if it's tailpress related or wordpress, so as I'm starting here.
I'm following (loosely) the Github Blog video on youtube, so far, so good.
The github blog has small dropdown carets in its menu (small down arrows that indicate that there is a submenu). This is not covered in the video, but anyway, I'm trying to put them there. So I'm writing a custom walker to do so. This walker checks for children, as shown in the code snippet hereunder :
The problem I have is that the $args->walker->has_children is false even if there is children, so the if part is never shown (if I remove the if, it shows fine).
My menu looks like this :
So it should show for the l'ASBL tag.
I'm blocked - and as this is not an expected behavior, my question is : does anybody stumbled on the same issue ? Could there be some kind of side effects from the submenu functions that are added by Tailpress ?
Beta Was this translation helpful? Give feedback.
All reactions