Arguments ignored/markup changed in wp_nav_menu if no menu is selected

Here’s the default usage of wp_nav_menu(): <?php $defaults = array( ‘theme_location’ => , ‘menu’ => , ‘container’ => ‘div’, ‘container_class’ => ‘menu-{menu slug}-container’, ‘container_id’ => , ‘menu_class’ => ‘menu’, ‘menu_id’ => , ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => , ‘after’ => , ‘link_before’ => , ‘link_after’ => , ‘items_wrap’ => ‘<ul id=\”%1$s\” class=\”%2$s\”>%3$s</ul>’, … Read more

wp_nav_menu including Skype URL

I believe the esc_url function is what ultimately filters the url you enter in that field. Unfortunately, I don’t see how you could allow the skype protocol without manually editing that function in the core file wp-includes/formatting.php, which is always a bad idea. if ( !is_array($protocols) ) $protocols = array (‘http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, … Read more

Get admin menu link

You can use admin_url(‘nav-menus.php’); This function can be used to get url’s for any admin screen, please check out the codex for more information http://codex.wordpress.org/Function_Reference/admin_url

Two Search pages, One search form

Hook into ‘template_include’ and change the template here. Made up example, not tested: add_action( ‘template_include’, ‘wpse_96472_search_template’ ); function wpse_96472_search_template( $template ) { if ( ! is_search() ) return $template; if ( empty ( $_GET[‘post_type’] ) ) return $template; if ( ‘poster’ === $_GET[‘post_type’] ) return get_template_directory() . ‘/poster-search-template.php’; if ( ‘house’ === $_GET[‘post_type’] ) return … Read more

Restrict post navigation to current sub menu

As @Ravs mentions the third parameter in next_post_link()/previous_post_link() should be a boolean value indicating whether to restrict the link to a post in the same category. By default this is false. If set to true, it will choose the next (or previous) post which is in the same category as the current post. This includes … Read more

Link to previous month’s posts

$archive_month = date(‘m’, strtotime(‘1 month ago’) ); $archive_year = date(‘Y’, strtotime(‘1 month ago’) ); echo ‘<a href=”‘ . get_month_link( $archive_year, $archive_month) . ‘”>Last month\’s posts</a>’;

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