How to define category ID in an array?

As Geert pointed out, your current conditional will always be true. An if() construct needs to be fed an expression. You’re feeding it a valid array, so that’s true. Always. So far this is basic PHP, regardless of whether in a WP environment or not. As can be read in Chris_O’s comment if ( is_category(‘some-cat’) … Read more

Fetch all categories from database

get_categories function will return an array of objects, each object a category. You can read more about it here: https://developer.wordpress.org/reference/functions/get_categories/ Edit And example, as Tim Malone mentioned in the comment there are examples on that page. But here is a simple one for you, that will display your categories in a list. $categories = get_categories(); … Read more

How to show posts of a specific category

Change $myposts = get_posts( ‘numberposts=6&offset=$debut’) to $myposts = get_posts( ‘numberposts=6&category_name=home-slider&offset=$debut’) OR $myposts = get_posts( ‘numberposts=6&category=1&offset=$debut’) replace 1 with your category ID Hope this helps

completely confused with archive.php, category.php

You don’t assign category templates to pages. They are templates that will be used automatically when you view a category. Read the Template Hierarchy documentation. You’re using WordPress completely wrong. You don’t create pages for archives, they exist automatically.

Moving Blog and Changing URL

Take a look at my plugin T5 All URIs. It prints all current URIs for posts and terms. From function print_term_uris(): $terms = get_terms( get_taxonomies(), array ( ‘hide_empty’ => FALSE, ‘get’ => ‘all’ ) ); foreach ( $terms as $term ) { print “\n” . get_term_link( $term ); } But if you keep the same … Read more

Add product category to post_class

Untested, but adapting from the Codex example for filtering the post class… basically changing get_the_categories() to get_the_terms and accounting for the name of the Product Category taxonomy. // add category nicenames to post class function product_category_class($classes) { global $post; foreach((get_the_terms($post->ID, ‘product_cat’)) as $term) $classes[] = $term->name; return $classes; } add_filter(‘post_class’, ‘product_category_class’);

how to implement next/prev within category archive?

It sends you to the next/prev post by date of been published. I don’t know what gives you these next/prev links and where (single.php, category.php, archive.php or any other custom template file). Without knowing more (some code example) all that I can give to you is this: $page_nr=”&paged=”; $page_nr = get_query_var( ‘paged’ ) ? $page_nr.get_query_var( … Read more

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