Output existing wp_nav_menu with a custom walker

By default wp_nav_menu() outputs the navigation markup. If you want to store it or want to concatenate it with other string then you’d have to set the echo parameter to false (by default it’s true). $output .= ‘<ul class=”sub-menu”> ‘ . wp_nav_menu( array( ‘theme_location’ => ‘col_1’, ‘menu_id’ => ‘col_1’, ‘menu_class’ => ‘col_1’, ‘container’ => ”, … Read more

Next / Previous post in a single category

You can use the combination of in_same_term and excluded_terms. First of all, you have the ID of the category you want to display post from. Next, get all the id of the category of the post by using wp_get_post_terms You can iterate through the returned terms and build an array of terms that you want … Read more

Creating a link to the first post in a category

Given a category ID, in this example as the variable $cat_id, you would do this by querying 1 post in that category, ordered by date in ascending order (oldest first). Then use that result to get the permalink to that post. $posts = get_posts( ‘numberposts’ => 1, ‘order’ => ‘ASC’, ‘cat’ => $cat_id, ); if … Read more

Superfish Dropdown menu broken after WP 4.9.5 upgrade

This is the wrong place as this is not a wordpress-related question (well, or the answer isn’t wordpress related), but here is what you do: Get all your files through HTTPS (especially extern files) or just download the extern files and host them on your webspace/server/cloudd. This isn’t only more efficient and resistant to unexpected … Read more