Tag Info

New answers tagged

0

Two things I notice on your site: 1) jQuery is loading twice and on them is over http while your site is on https 2) Try changing $(function() { // Create the dropdown base $("<select />").appendTo("nav"); .... }); to jQuery(function( $ ) { // Create the dropdown base $("<select />").appendTo("nav"); ... });


0

This sounds awful from an SEO perspective but you could do this: Note The reason ( I believe ) you'd have to do this in a query is because of the fact Wordpress doesn't by default have a "Page Archive" so you wouldn't be able to do this with changing some .htaccess and "easy-peasy" it's done... It would be a little more involved. Create a page or ...


1

Seems to be good old-fashioned css-problem: The top level li is 93 px high (by the link in it: 38px padding top, 16px line-height, 39px padding-bottom), the sub-navigation starts at top: 96px. Now for the backgrounds of your problem: The subnavigation is shown while your mouse hovers over the li (or something within the li). While you move your mouse from ...


0

Found this on another Answer http://wordpress.stackexchange.com/a/105562/105 , but this question came up first when searching; so cross linking for future searchers add_filter('wp_nav_menu','replace_last_nav_item',100,2); function replace_last_nav_item($items, $args) { return substr_replace($items, '', strrpos($items, $args->after), ...


1

I believe, most obvious choice would be to create two categories "Fall-Winter" and "Spring-Summer" and put four other categories in both of them. Your URLs would be like this /category/fall-winter /category/fall-winter/formal-wear /category/fall-winter/night-wear Now, to list the formal wear for both fall-winter and spring-summer on page, we have few ...


0

I had the same problem, and I found, after reading well the codex, that my post type had a custom taxonomy, not named "category" (default to WP), but "categories", so to be functional here the code I had to write: <?php previous_post_link('%link', '<i title="Previous Project" class="prev"></i>', true, array(), 'categories') ?> <?php ...


1

I'm not sure if this is going to solve your whole issue, but you can add the paged parameter to your current custom query. I don't know why you have set the offset parameter. If your offset is 0, omit it completely Also, remember to reset your post data after your custom query. Try something like this as a start and then work from there <?php $paged = ...


0

What you might be looking for is http://scrollnav.com. We use this for Aesop Story Engine in our Chapter and Timeline components.


0

I have deleted the nav.php file from my header.php, and added back the old menu code that comes with Wordpress. I did some hooking into my style.css file to adjust the styles for the desired design and I only used the #menu-navmenu that I created in WordPress to float right my menu bar. ul#menu-navmenu{float: right;} So before I had this ul#menu {float: ...


0

In your PHP file, set $thisPage before you include('nav.php');. Then, the variable $thisPage will be passed to nav.php and processed in its if statement. This is really bad practice though, and a better way of doing it would be by creating your menu in WordPress itself and hooking it into your template. WordPress documents how to do this well.


0

To see the menu, you need to set it up in the wordpress admin side. Go to Appearance -> Menus You should see a "Manage Locations" tab. Select it. You should see your "Main Menu" location. Choose the menu that you created there. Select Save Changes. Since you used "theme-location" to set up drawing it, you need to set a menu to your theme location to ...


0

get_next_posts_link() won't work in is_single() context - see source - and is intended for paged content. For the is_single() context use next_post_link() and previous_post_link() to echo the output. Or to return the output get_next_post_link() and get_previous_post_link().


0

What I would do is remove all that code you have in nav.php displaying the menu, create the menu inside the Wordpress backend, then you'll be able to use .current-menu-item in your css. Then all you need to call the menu will be wp_nav_menu(); Here is the documentation for that function: http://codex.wordpress.org/Function_Reference/wp_nav_menu


0

If your theme is using wp_nav_menu() you will have the class current-menu-item added to the relevant <li> element for you. Does this help?


1

You are missing a link. The posts are not assigned to the menus directly. There is a post type nav_menu_item in nav_menu taxonomy which links posts (or other kinds of destinations) to their place in menu. This snippet should get you started on retrieval: $menu_items = get_posts( [ 'post_type' => 'nav_menu_item', 'meta_query' => [ [ ...


1

As I previously said in a comment You are using invalid values in get_previous_post() and get_next_post(). You are better of here writing your own function I came up with the following. : Get an array of all the posts and determine the current post's position. Get the post ID's of the posts on both sides of the current post. The amount of ID's ...


0

The trick is that this function only works on current post. But that is something that you can adjust. So in principle something like this should work (not tested): global $post; $post = get_next_post(); setup_postdata( $post ); // the next is now current // do things $post = get_next_post(); // and this time we got the next for next // do more things ...



Top 50 recent answers are included