• Hello Support team,

    I’m having issue with format of text. Let me explain it. I’m using Urdu language for blogs some pages. If I include an English word somewhere in a sentence it’l throw the format out. Like Urdu start from right to left and I change the alignment from left to right from the editor. How to fix this problem that I can include some English word(s) in a sentence.
    Second problem is slug. Whenever I share the a blog in twitter it will show some character instead of name, like below. I recently installed “Yoast SEO” and it is having the same issue in slug. How to fix this issue.
    %d8%a7%d9%86%d8%b3%d8%a7%d9%86%db%8c%d8%aa-%d8%a7%d8%a8%da%be%db%8c-%d8%aa%da%a9

    I really appreciate your help.

    • This topic was modified 4 years, 7 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

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

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

    (@bcworkz)

    Would you please provide a link to a page demonstrating the issues you describe? An Urdu page with an English word that throws off the format. And an URL that has the odd %d8%a7%d9 characters when shared. The URLs I see are all plain Latin characters and should not be converted to odd characters.

    The formatting issue is likely an issue with your theme and you’ll need to go through your theme’s support for resolution. But if there’s an easy fix we can spot from here, we’ll let you know. In any case your theme’s support will also need to see a page demonstrating the issue.

    BTW, the odd character URLs will work fine, they just do not always display correctly. They are used to reliably share working URLs among varying apps with different character sets. In some cases if you were to share an Urdu URL without the conversion it might not work at all.

    Thread Starter rozard

    (@rozard)

    For the slug I think I’ll edit it and change to English words, because my users feels it’s suspicious link.

    This is what it happens when I include English words. “Helping Hand” and “Self Hand” were right side of the paragraph, when I started writing Urdu, it switched it’s position to left. If you can be able to help it really appreciate that.

    ? ???? ????? ??? ??? ?? ??????? ?? ???? ??? ????? ???? ??? ?? ?????? ???????? ?? ????? ????? ??? ???? ??? ??????? ?? ????? ?? ??? ????

    Helping hand ??? Self Hand ?? ????? ??? ??? ???????? ?? ????? ????? ??? ??? ??? ???? ?? ????? ????? ????? ?? ???? ???? ???? ????? ??? ??????? ?? ???? ?? ??? ???? ???????? ?? ?? ??? ?? ?? ???? ??? ?? ?? ??? ?????? ????? ????? ?? ???? ????? ????? ??? ??? ?? ?? ??? ?? ?? ?? ??

    Moderator bcworkz

    (@bcworkz)

    Your Urdu pages need this CSS rule to properly handle English words, but English pages should not have it (or set direction to “ltr”):

    p {
        direction: rtl;
    }

    It might not be that simple to make a distinction if your site is not setup to be polylanguage.

    You could patch up individual paragraphs in code view where the problem occurs by editing the related <p> tag to include an inline style. Like so:
    <p style="direction: rtl;">

    • This reply was modified 4 years, 7 months ago by bcworkz. Reason: wrong style example
    Thread Starter rozard

    (@rozard)

    If I include

    p {
    direction: rtl;
    }

    in additional CSS section, it will work but problem is that it’ll change the direction all English blog posts. I mean the direction already made it from right to left. Whenever I write any urdu blog the direction is automatically start right to left, but if I write a english blog then change the direction right to left from the Blog editor. If I add above line in “Additional CSS” section it moves the full stops and question marks from left to right from the English posts. I added the second piece of code in Blog page CSS section, it didn’t make any difference. Any other idea how make it work. Thanks

    Moderator bcworkz

    (@bcworkz)

    Yes, it cannot be applied universally if you have English language content. To save you from manually applying style attribute overrides in every paragraph, ideally every blog post would have an overall element class which is either rtl or ltr (or urdu or english, anything distinguishing one from the other). Then you could have CSS to address both.

    .rtl p {
        direction: rtl;
    }
    .ltr p {
        direction: ltr;
    }

    You could utilize a custom field which is set for each post. Then modify templates to check this field and output the appropriate class for each post’s overall container.

    I’ve recorded this issue in the Gutenberg repo:
    https://github.com/WordPress/gutenberg/issues/21517

    Thread Starter rozard

    (@rozard)

    Hi @bcworkz, unfortunately it is not working for me. Even for demonstration I tried with both and Urdu and English posts, neither worked.

    Is there any short CSS code for Title? I mean the default title I made right to left and all English title are right side of the page. Is there any way to overwrite that I can add CSS in each English posts which’s title changed left to right?

    Moderator bcworkz

    (@bcworkz)

    There is a way if code can somehow quickly determine which language the title is in, such as a custom field for example. Post titles can usually be filtered, so when appropriate the title can be wrapped in a span tag with a “ltr” element style.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Having issue with text format and slug’ is closed to new replies.