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 –>

Menu Arrow for Child Element

To add arrow for parent elements: jQuery + CSS Solution: JQUERY: jQuery(function($){ $(document).ready(function(){ $(‘ul.sub-menu’).parent().addClass(‘drop-down’); // Add Sub-Menu Class to insert personalized style $(‘li.drop-down > a:first-child’).wrapInner(‘<span class=”menu-bullet” />’); // Add .menu-bullet in span to insert your arrow image background }); }); CSS: div#nav ul li.drop-down a .menu-bullet {display:block; background:url(your_image_path.jpg) no-repeat; padding-left:15px; /* padding left value is … Read more

Organizing the Navigation Menu

Check nav menu target URL for ‘/pressroom/’, then check if it’s a post. If it fits, add custom class to that menu item. <?php function my_add_posts_page_ancestor_class( $classes, $item ) { if( false !== strpos($item->url, ‘/pressroom/’) && is_single($item->ID) && !is_page($item->ID) ) { $classes[] = ‘my-ancestor-class’; } return $classes; } add_filter(‘nav_menu_css_class’, ‘my_add_posts_page_ancestor_class’, 10, 2); The code is … Read more

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

Sticky menu for WP custom menubars

What you could do is the following: 1) Make a javascript-file and put the following content into it: $(function(){ var stickyHeaderTop = $(‘#stickyheader’).offset().top; $(window).scroll(function(){ if( $(window).scrollTop() > stickyHeaderTop ) { $(‘#stickyheader’).css({position: ‘fixed’, top: ‘0px’}); } else { $(‘#stickyheader’).css({position: ‘static’, top: ‘0px’}); } }); }); 2) Save this file in your theme folder as (for example) … 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

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