How to reverse post navigation at bottom of post

You need to swap their arguments & rel tag too: <?php echo str_replace( ‘rel=”next”‘, ‘rel=”prev”‘, get_next_post_link( ‘%link’, _x( ‘<span class=”meta-nav”>&larr;</span> %title’, ‘Previous post link’, ‘twentythirteen’ ) ) ); ?> <?php echo str_replace( ‘rel=”prev”‘, ‘rel=”next”‘, get_previous_post_link( ‘%link’, _x( ‘%title <span class=”meta-nav”>&rarr;</span>’, ‘Next post link’, ‘twentythirteen’ ) ) ); ?>

Ussing page_navi with WP_Query

Just work including that code in the functions file: function mod_query($query){ $entradas = get_category_by_slug(‘anuncios’); if ((!is_admin() && $query->is_main_query())){ $query->set(‘posts_per_page’,”2″); $query->set(‘cat’,’8′); } } add_action(‘pre_get_posts’,’mod_query’); The file to show the content of the category is a normal file (without extra configuration) Thanks to @Pieter Groosen for the orientation.

how to insert data in li tag of navigation

There are a few ways to do this and they mostly revolve around the walker_nav_menu_start_el filter. I’d be inclined to add custom fields to the nav menu items: one for the image and one for the image’s alternate text. That way, users can update the images and developers aren’t required to keep a hash of … Read more

Multiple navigation menu in same location

Create multiple menus for each parent page and use an if condition to test which is the parent page and output that particular menu. You could keep the menu names the same as the parent page names so that any future pages created with new menus will still work. empty( $post->post_parent ) ? $post_parent_name = … Read more

Style wp_link_pages as a select drop down list

Here’s one way to achieve that is by constructing the <option> tags with the wp_link_pages_link filter: add_filter( ‘wp_link_pages_link’, function( $link, $i ) { return sprintf( ‘<option value=”%d” %s>%d</option>’, $i, selected( $i, get_query_var( ‘page’, 1 ), 0 ), $i ); }, 10, 2 ); and then the <form> and <select> tags with the wp_link_pages filter: add_filter( … Read more

How to test if a specific page is the front page?

You could try to replace: if (is_front_page()) { $menuIdOfCurrentPage = 0; with a check for the page_on_front option: if( is_int( $postID ) && $postID > 0 && $postID === (int) get_option( ‘page_on_front’ ) ) { $menuIdOfCurrentPage = 0; Here we added a check to see if $postID is a positive integer, because the page_on_front option … Read more

Conditional menus based on page title

As you can read from the documentation register_nav_menu is used to register a menu in the menu editor. Your code will affect the backend only. Also you should pass a slug like string as the first parameter. If you want to change the display of the menu, you could simple write a condition which will … Read more

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