Using categories on navigation bar instead of pages

Assuming you’re dealing with a recent version of WordPress it should be pretty straightforward. In your WordPress admin panel, select Appearance->Menus. Create a new menu. In the current wordpress there’s a little plus sign at the top, enter a new menu name, and then click create menu. On the bottom left there should be a … Read more

add a menu item to navigation menu to link to external url

Are you trying to navigate to an external page or redirect? (Also, bear in mind that was posted almost 3 years ago…in websites and technology in general, that’s an eternity!) You could always just add a custom link to the WordPress menu under Appearance->Menus. Just make sure you add support in the functions.php file. http://codex.wordpress.org/Appearance_Menus_Screen … Read more

Switch form Next/Previous to post title

Thats WordPress default usage.. Just remove the content within the brackets: <nav id=”nav-single”> <h3 class=”assistive-text”><?php _e( ‘Post navigation’, ‘admired’ ); ?></h3> <span class=”nav-previous”><?php previous_post_link(); ?></span> <span class=”nav-next”><?php next_post_link(); ?></span> </nav><!– #nav-single –>

How can I add a delay to the collapsible menu in Twenty Eleven?

Superfish is a script that will add a delay to the hover action. It is used in a lot of themes, for instance I know it is used in the Thematic Theme. Untested, but I think this is how you’d apply it (based on the docs). function wp88740_enqueue(){ wp_enqueue_script(‘jquery’); wp_enqueue_script(‘hoverintent’, get_stylesheet_directory() . ‘/scripts/hoverIntent.js’ ); wp_enqueue_script(‘superfish’, … Read more

navigation link based on custom field

Check out get_next_post_sort and get_previous_post_sort filters. You can modify the ORDER BY clause to whatever you want (including ). For example, if you want to sort the ‘next post’ to be the post with the smallest adjacent post ID: function wp28041_get_next_post_sort($where){ return ‘ORDER BY ID ASC LIMIT 1’; } add_filter(‘get_next_post_sort’, ‘wp28041_get_next_post_sort’); You don’t have to … Read more

How does the Twenty Twelve Navigation Bar work?

The code in question is in header.php, line 45. <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘nav-menu’ ) ); ?> This is the Codex reference to this function: wp_nav_menu. From my experience, and some googling, this previous answer has the answer you’re looking for. If possible, would just adding a class to the sub-menus … Read more

Check if current post is the latest (not last)

Simply query for the latest post and compare IDs: function wpse110867_is_latest_post( $post_id, $query_args = array() ){ static $latest_post_id = false; $post_id = empty( $post_id ) ? get_the_ID() : $post_id ; if( !$latest_post_id ){ $query_args[‘numberposts’] = 1; $query_args[‘post_status’] = ‘publish’; $last = wp_get_recent_posts( $query_args ); $latest_post_id = $last[‘0’][‘ID’]; } return $latest_post_id == $post_id; } Example Usage … Read more

How to add rel=”nofollow” to wp_list_pages?

use wordpress build in funcion for that “wp_rel_nofollow” with a hook to wp_list_pages. paste this code in your theme’s functions.php file and you are set. function add_no_follow($output){ return wp_rel_nofollow($output); } add_filter(‘wp_list_pages”https://wordpress.stackexchange.com/questions/7688/,”add_no_follow’); hope this helps.

reverse next/prev page order

This is because it is, by default, done as ‘previous page’ on the left, and ‘next page’ on the right. Posts appear in reverse chronological order, with the latest post first, so ‘next page’ means going back in time. So in terms of pages it makes sense, in terms of chronology it doesn’t. Anyway… this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)