Tag Info

New answers tagged

0

Use the last-child pseudoclass in the CSS: .mainnav li:last-child { /* your code */ }


0

You can add classes natively via interface in admin. Open Screen Options (top right of the screen) and check CSS Classes. I don't remember if class applies to link itself, but you can always target link inside container with CSS (.class a).


0

This question has the same solution as that one. The answer is short, so I post it here as well: In WordPress 3.9 (and still in 3.9.1) there's a bug concerning the excluded terms in get_adjacent_post(). There's a plugin to fix that bug.


0

In Word.ress 3.9 (and still in 3.9.1) there's a bug concerning the excluded terms in get_adjacent_post(). There's a plugin to fix that bug.


0

It technically is working correctly. The difference is that on the first click, the browser is advancing the scroll natively to the identified section, which does not account for the space taken by your navigation, which is positioned as fixed. The second click is using JavaScript to adjust the scroll on the current page, and does account for the space taken ...


0

wp_nav_menu( array( 'menu_id'=>'nav', 'theme_location'=>'header-menu' , 'depth' => 1) ); you can use depth parameter for this.. Click here! More Info: child theme Create child theme and copy code from header.php of parent theme then replace the code wp_nav_menu( array( 'menu_id'=>'nav', 'theme_location'=>'header-menu' ) ); with the ...


0

I tried your code it works perfectly fine for me, to give output as: <div class="container_class" id="container_id"> <ul class="menu_class" id="menu_id"> <li class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-154"><a href="http://www.ohitsfunny.com/category/funny/">Funny</a></li> <li ...


0

WordPress allows the addition of extra nav menus. Add this to your child themes functions file: register_nav_menus( array( 'secondary_menu' => 'My Second Menu' ) ); Add this to your header.php file or the file where you want to display your extra nav menu. <nav id="site-navigation" class="main-navigation" role="navigation"> ...


0

Your code: ul#menu-menu-1 > li,a:first { margin-left: 0px; } You need to apply the first-child to the list element, and not to the link. You should also not have a comma. Comma indicates a new selection. Try this: ul#menu-menu-1 > li:first-child a{ maegin-left:0px; } *first-child does not work in ie8 and earlier.


0

As already pointed out, this is a CSS-specific question. Here is one approach to do this, anyway: /* Reset left margin for ALL items */ ul.menu li { margin-left: 0; } /* Set it back for any item that's not the first one */ ul.menu li + li { margin-left: 10px; } Depending on your current CSS, you might have to change the selectors (e.g., use a ...


0

Use previous_image_link and next_image_link in a image.php or attachment.php file. <nav id="image-navigation" class="navigation image-navigation"> <div class="nav-links"> <?php previous_image_link( false, '<div class="previous-image">' . __( 'Previous Image', '$text_domain' ) . '</div>' ); ?> ...


0

Use a date query to get the next and previous (attachment) post by date. And exclude all child attachments from the current parent post. <?php // use in template for single attachment display // get all children ids (to exclude from the queries for next and previous post) $args = array( 'post_status' => 'inherit', 'post_type' => ...


0

A filter solution could be the nav_menu_css_class filter. A CSS solution could be to use the body_class to make more specific css rules.


1

Good that it works. If it's for a client or if you just want cleaner code, you can do it as @Tom J Nowell suggested. Add a custom menu item, link it to nowhere or anywhere. Find out the menu item ID (every item has one), and then target that ID with jQuery. $("#menu-item-num").on("click", function(e){ e.preventDefault(); // olark code here ...


1

Solution #1 (not ideal, but it works): // Live Chat Utility Link add_filter( 'wp_nav_menu_items', 'live_chat_utility_link', 10, 2 ); function live_chat_utility_link ( $items, $args ) { if ( $args->theme_location == 'utility' ) { $items .= '<li><a href="javascript:void(0);" onclick="olark(\'api.box.expand\')" class="livechat">Live ...



Top 50 recent answers are included