Problem when I try to insert pagination

Thanks for @PieterGoosen for his help, I found the solution for my problem. In my functions.php, I construct the next function: function mod_query($query){ if ( !is_admin() && $query->is_main_query() && $query->is_category(‘6’)){ //My Category ID $query->set(‘posts_per_page’,2); } } add_action(‘pre_get_posts’,’mod_query’); And I needed one file, category-blog.php where I build my html code and use the php code if … Read more

Get current post’s nav menu name (term name)

You are missing a link. The posts are not assigned to the menus directly. There is a post type nav_menu_item in nav_menu taxonomy which links posts (or other kinds of destinations) to their place in menu. This snippet should get you started on retrieval: $menu_items = get_posts( [ ‘post_type’ => ‘nav_menu_item’, ‘meta_query’ => [ [ … Read more

Nav-Menu not showing up

To see the menu, you need to set it up in the wordpress admin side. Go to Appearance -> Menus You should see a “Manage Locations” tab. Select it. You should see your “Main Menu” location. Choose the menu that you created there. Select Save Changes. Since you used “theme-location” to set up drawing it, … Read more

Custom navigation : show posts in sets of 4

I’m not sure if this is going to solve your whole issue, but you can add the paged parameter to your current custom query. I don’t know why you have set the offset parameter. If your offset is 0, omit it completely Also, remember to reset your post data after your custom query. Try something … Read more

Multiple categories for one menu item?

I believe, most obvious choice would be to create two categories “Fall-Winter” and “Spring-Summer” and put four other categories in both of them. Your URLs would be like this /category/fall-winter /category/fall-winter/formal-wear /category/fall-winter/night-wear Now, to list the formal wear for both fall-winter and spring-summer on page, we have few following options Create formal wear etc as … Read more

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