• Resolved sacconi

    (@sacconi)


    This is working in italian but not in german

    How can I modify https://pastebin.com/e8hshrSG ?

    I’m filtering the category this way

    add_filter('get_the_archive_title', function( $title_archive) {
       $locale = get_locale();
       if ('de_DE' == $locale ) {
    
       $title_archive_de = get_term_meta( get_queried_object()->term_id, 'category_de', true );
    
         if ( ! empty( $title_archive_de )) {
            return $title_archive_de;
         } else {
            return $title_archive;
         }
       } else {
         return $title_archive;
       }
    }, 10, 2 );
    

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I think the count function you linked to is running before the translation function posted here. Thus the translation overwrites the count. If I’m right, you only need to get the translation function to run earlier than the count function. To do so, change the 10 near the end of the translation hook to a lower number such as 5.

    Thread Starter sacconi

    (@sacconi)

    ok, this is done

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Printing the number of posts’ is closed to new replies.