Get category from slug list

$category_slug_array = array(‘slug_1’, ‘slug_2’, ‘slug_2’); //array of category slugs foreach($category_slug_array as $category_slug){ $my_categories[] = get_term_by( ‘slug’, $category_slug, ‘category’); //getting category object by slug } print_r($my_categories); //printing array of categories

add .html to custom post type with WPML

Aleluhia ! it was because $type don’t use WPML function Here is the code that works perfectly with WPML and translated slug : // .html pour les customs posts function rewrite_rules($rules) { $new_rules = array(); foreach (get_post_types() as $t) $new_rules[$t . ‘/(.+?)\.html$’] = ‘index.php?post_type=” . $t . “&name=$matches[1]’; return $new_rules + $rules; } add_action(‘rewrite_rules_array’, ‘rewrite_rules’); … Read more

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