skip to Main Content

WordPress Code Snippets


Fetch All Translated Categories in WPML

This snippet allows you to display all available categories in multiple languages, enhancing content organization.

$categories = get_categories();
foreach ($categories as $category) {
    $translated_category = apply_filters('wpml_object_id', $category->term_id, 'category', false, ICL_LANGUAGE_CODE);
    echo get_term($translated_category)->name; // Display category name
}


I’m a WordPress developer with 10+ years of experience in WooCommerce and custom plugins. I combine technical expertise with design flair to help you create standout, user-friendly websites. Let’s transform your digital presence!

Best WordPress Hosting
Back To Top
Search