- This topic has 6 replies, 2 voices, and was last updated 7 years, 10 months ago by Tom.
-
AuthorPosts
-
June 13, 2016 at 11:35 am #201643Marcel
Hi,
I need to additionally wrap each menu item in a span. I tried to add
‘link_before’ => ‘<span>’,
‘link_after’ => ‘</span>’,
into the wp_nav_menu and add the navigation.php to my child theme but there is no effect.Any idea how to could achiev this?
Thanks in advance
MarcelJune 13, 2016 at 1:07 pm #201678TomLead DeveloperLead DeveloperHi there,
Can you show me the code you added? Be sure to highlight it and click the “code” button in the editor here ๐
June 13, 2016 at 11:04 pm #201756MarcelHi,
thanks for getting back so quick.In the navigation.php from the inc directory I added the link_before and link_after inside here (line 94):
wp_nav_menu( array( 'theme_location' => 'primary', 'container' => 'div', 'container_class' => 'main-nav', 'container_id' => 'primary-menu', 'menu_class' => '', 'fallback_cb' => 'generate_menu_fallback', 'link_before' => '<span>', 'link_after' => '</span>', 'items_wrap' => '<ul id="%1$s" class="%2$s ' . join( ' ', generate_get_menu_class() ) . '">%3$s</ul>' )
I’m using Menu Plus with a sticky menu by the way. I don’t know if have to adjust other files as well or if I have to switch to jquery to force the span around.
Would be great if you could get me on the right track with this.
All the best
MarcelJune 13, 2016 at 11:54 pm #201770TomLead DeveloperLead DeveloperHmm, tough one.
Just as a test, what happens if you wrap your navigation labels in span tags inside “Appearance > Menus”? Does that insert them into the correct area?
June 14, 2016 at 2:18 am #201798MarcelHi Tom,
thanks it does the trick tough I would have preferred a way without touching the menu hardcoded but all good. Another quick question then I let you off the hook ๐
I tried to display the post thumbnail in the single article but it won’t show off. What do I have to do to make it work?
I already added add_theme_support( ‘post-thumbnails’ ); in my functions.php
I use the Masonry look but that should not affect the appearance of the single article.
I want to have the post thumbnail displayed at 100% width preferable as a scaling background image but I’m not quiet sure how to set it up.Thanks in advance
MarcelJune 14, 2016 at 3:27 am #201805MarcelHi again,
found the error myelf.
If you try to use sections in the backend editor the post thumbnail is not displayed.
It only shows up when using the regular editor mode.Don’t know if you realised but it would be great to use the sections on pages and articles in the future. Other than that: Great job on the add-ons as always.
Cheers,
MarcelJune 14, 2016 at 10:29 am #201963TomLead DeveloperLead DeveloperAh yes, Sections will remove the featured image, sidebars etc..
This allows you to add the image inside your top section and apply whatever necessary styles to it.
-
AuthorPosts
- You must be logged in to reply to this topic.