• Resolved The_Waste_Land

    (@the_waste_land)


    Hello!

    I have been using this awesome theme with qTranslate for some time (thanks to acub for this post), but I’ve been having trouble since the hosting was switched from Windows to Linux.

    Two of the three featured pages in the home page won’t show the Italian text (which is the default language) but will show the English text if this language is selected.

    I thought it might have something to do with the characters limit, but I raised it to 500 and it still doesn’t work.

    It’s been a while since I last fiddled with html, css, php etc. so I’m a bit lost.

    Thank you all for your help!

    https://www.theslowtour.it

Viewing 8 replies - 1 through 8 (of 8 total)
  • Which plugin are you using?
    Q-translate? or qtranslateX ?
    This theme dropped to support of qtranslate (unmantained) in favor of qtranslateX long time ago.
    Does this happen with qtranslateX too?

    Thread Starter The_Waste_Land

    (@the_waste_land)

    I’m currently using qtranslate: I will try to switch to qtranslateX and see what happens.

    Thank you for your suggestion!

    Thread Starter The_Waste_Land

    (@the_waste_land)

    I switched to qTranslate X, had to make a few adjustments to get things back the way they were with qTranslate but no luck with the featured pages…

    What puzzles me is the fact that one of them works just fine.

    Ok,
    so the problem should be the length of the text.
    Can you paste, like in pastebin, the whole text you want to display?

    which kind of adjustments did you make?
    Also, does this happen with the parent theme too?(I see you’re using a child-theme)

    Thread Starter The_Waste_Land

    (@the_waste_land)

    Hi d4z_c0nf,

    thank you for your help!

    This happens with the parent theme too.

    What I did was raising the characters limitations to 500 instead of 200, following this post:

    To remove the 200 chars limitation for featured pages description (between the image and the button, on first page) you need to comment out lines 118 to 125 in /wp-content/themes/customizr/parts/class-content-featured_pages.php.

    An alternative to removing the limitations is to set them higher, in accordance with the number of languages your multilingual website will be set to (double the limit for 2 languages, triple it for 3, etc.).

    I think the lines of code are 154-156 in my child-theme file and look like this:

    //limit text to 500 car per language
    $default_fp_text_length = apply_filters( 'tc_fp_text_length', 500 );
    $text = ( strlen($text) > $default_fp_text_length ) ? substr( $text , 0 , strpos( $text, ' ' , $default_fp_text_length) ). ' ...' : $text;

    Here is the text I put into the featured text fields: https://pastebin.com/WEfnHb1L

    Thank you very much again!

    Ok,
    it’s a “bug” in the way the text is trimmed.
    Will be solved in the next theme release (most likely :)).
    Anyway:
    1) this theme supports qtranslateX so you really don’t need anything in your child-theme to do that.
    2) acub’s post was written when this theme had no support for qtranslate or qtranslateX so you really should not consider it.
    3) acub’s code is the base of the current compatibility code :D, and was introduced more than one year ago.

    So first
    remove all the useless thing from your child-theme like that file otherwise you’ll override the parent theme files and you’ll miss future enhancements (e.g. the fix for this bug).

    For the first text use this (italian part):
    SlowTour è un servizio professionale specializzato nel business tourism, per assistere le aziende nella delicata gestione degli ospiti. Un nuovo punto di incontro tra impresa, turismo e territorio.

    as you can see I just changed “d’incontro” with “di incontro”, I think it’s fine, right?
    It should work (works here – the quote is escaped and it results in more characters https://www.htmlhelp.com/reference/html40/entities/special.html).

    For the second text (italian part):
    Ampia scelta di attività, da itinerari culturali ed enogastronomici allo shopping di qualità, che rendono più appagante e rilassato il soggiorno lavorativo nel territorio dove opera la tua azienda.

    Is it fine?

    Thread Starter The_Waste_Land

    (@the_waste_land)

    Yay, it works now! I used Unicode for the quote and suddenly remembered that I had the same problem at the beginning, with letters with accents.

    Thank you for your help and the suggestions: I suspected that the adjustments were no longer necessary, but I was afraid to take them down. I have removed them now.

    Have a nice day! ??

    Good solution.
    Better ??
    Have a nice day you too.
    Anyway the problem will be fixed soon (I mean the fact that the text can be reverted to a “…”).

    Glad you solved.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘qTranslate and featured pages’ is closed to new replies.