• Resolved Subhash.at

    (@subhashat)


    I have a website where in some categories there are only articles in one language. I hide this posts in the other language. But to hide this “empty” categories in the sidebar widget does’nt work. So if you click on such a link a 404 is the result.

    Any suggestions how to get this to work?

    https://wordpress.org/plugins/qtranslate-x/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter Subhash.at

    (@subhashat)

    The URL is http://www.umweltethik.at

    Try to switch to English and choose “Umweltbildung” (last category) for example.

    Plugin Author Gunu

    (@grafcom)

    @subhash.at,

    try the following: go to Posts, Categories and in the category name Umweltbildung leave the English name empty.

    Thread Starter Subhash.at

    (@subhashat)

    Thank you for the tip but it does not work: an “empty” link is displayed.

    Plugin Author Gunu

    (@grafcom)

    @subhash.at,

    I’ve also tried it with your theme (uu-2014) and it works for me on my test site.

    Temporarily deactivate all other plugins and see if that makes a difference.

    If so activate them one by one and see where it goes wrong.

    Thread Starter Subhash.at

    (@subhashat)

    Sorry, it doesn’t work for me. Maybe because “Umweltbildung” is a child-child-category and parents and grandparents have posts?

    (I’m using a child theme of uu-2014 but didn’t change the widgets.)

    Plugin Author Gunu

    (@grafcom)

    @subhash.at,

    Maybe because “Umweltbildung” is a child-child-category and parents and grandparents have posts?

    I will also try….but I’m going to eat first 🙂

    Thread Starter Subhash.at

    (@subhashat)

    Enjoy your meal!

    Thread Starter Subhash.at

    (@subhashat)

    Maybe because “Umweltbildung” is a child-child-category and parents and grandparents have posts?

    That’s not really correct: The parent includes other categories which have posts and so does the grandparent.

    Plugin Author Gunu

    (@grafcom)

    @subhash.at,

    I got Category-1 – no parent – with post
    sub category-2 – parent Category-1 – with post
    sub sub category-3 – parent category-2 – with post

    sub category-2 and sub sub category-3 with German names empty

    Not visible among German language button.

    Settings – Languages – General Settings – Hide Content which is not available for the selected language. Unchecked
    Show displayed language prefix when content is not available for the selected language. Checked
    Show content in an alternative language when translation is not available for the selected language. Unchecked

    Advanced Settings – Use Pre-Path Mode (Default, puts /en/ in front of URL). SEO friendly. Checked

    Thread Starter Subhash.at

    (@subhashat)

    My setting is different:

    Category 1 – no parent – no post – name in both languages
    Sub category 2.0 – parent Category 1 – no post – name in both languages
    Sub category 2.1 – parent Category 1 – no post – name in both languages
    Sub sub category 3.0.0 – parent category 2.0 – with post – name in both languages
    Sub sub category 3.0.1 – parent category 2.0 – with post – name in both languages
    Sub sub category 3.0.2 – parent category 2.0 – with post – name only in German

    Sub sub category 3.1.0 – parent category 2.1 – with post – name in both languages
    Sub sub category 3.1.1 – parent category 2.1 – with post – name in both languages

    (Of course there are more categories and more posts per category as you can see in the sidebar. This is just an example.)

    Settings – Languages – General Settings – Hide Content which is not available for the selected language. Checked
    Show displayed language prefix when content is not available for the selected language. Unchecked
    Show content in an alternative language when translation is not available for the selected language. Unchecked

    Advanced Settings – Use Pre-Path Mode (Default, puts /de/ in front of URL). SEO friendly. Checked

    Result: Sub sub category 3.2 is shown in the sidebar with empty link text, valid link and wrong number of English texts.

    I tried your settings with my categories and posts and languages and it does not work for me.

    Plugin Author Gunu

    (@grafcom)

    Result: Sub sub category 3.2 is shown in the sidebar with empty link text, valid link and wrong number of English texts.

    The number of links is because this is a collection this is not language dependent. Which is here also.

    The pages when I click on that category is correct (Hide Content which is not available for the selected language. is now cheked) But the number counts all language versions.

    But how I change it, if I do not enter a name then the link is not visible in the menu of that language.

    Plugin Author Gunu

    (@grafcom)

    I’ll find something else strange.

    Look what difference that shows on your site:

    Check and uncheck in the widget – Show hierarchy

    Thread Starter Subhash.at

    (@subhashat)

    Yes, the number of links problem I understand and will work around by hiding the numbers.

    If I do not enter a name for the second (or first) language just for the other than the category is still shown in the sidebar. I don’t know why this difference to your tests appear.

    If I uncheck “show hierarchy” the list of categories is complete wrong and starts with “Biocentrism”.

    Thread Starter Subhash.at

    (@subhashat)

    Very strange: If I uncheck “show number of posts” in the categories-widget than it hides many categories, partly correct (no post in the selected language) partly incorrect (one post–but other categories with only one post are shown!)

    So I will try to resolve the problem by putting off the dynamic sidebar and writing two different sidebars for the two languages. Maybe it works.

    Thread Starter Subhash.at

    (@subhashat)

    So I will try to resolve the problem by putting off the dynamic sidebar and writing two different sidebars for the two languages.

    First I tried to put off dynamic sidebar and use wp_list_categories("show_count=1&use_desc_for_title=0&hierarchical=1&show&title_li=");. It shows the same wrong behaviour as described.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Hide empty categories!’ is closed to new replies.