Multilingual site with rtl and ltr direction - php

How should i implement site with two language that one language direction is rtl.
should i create form-rtl.css and main-rtl.css and check user language and if user have selected a rtl language i have to add this form-rtl and main-rtl.css files after yii css files?

The direction should be set in HTML (using the dir attribute), since it is an inherent property of a writing system, rather than casual presentation feature.
Some style settings may need to be set with due attention to directionality, so it makes sense to have separate CSS files for settings for RTL writing and for settings for LTR writing. But probably most of the CSS settings can be kept in one file.
So you could have something like this for an Arabic-language page:
<html lang=ar dir=rtl>
...
<link rel=stylesheet href=common.css> <!-- overall settings -->
<link rel=stylesheet href=rtl.css> <!-- settings specific to RTL writing -->
<link rel=stylesheet href=ar.css> <!-- settings specific to Arabic language,
e.g. font family settings -->

Related

How to correct HrefLang issues

I've tried to add the HrefLang at my shop to improve the SEO at other countries. But it doesn't work properly and I have this problem.
Noindex backlinks
This is the code. I've insert it at the head.tpl
The website is allowed at Spanish and English.
`
{block name='head_hreflang'}
<link rel="alternate" hreflang="es-es" href="https://nameofmysite/example/es/">
<link rel="alternate" hreflang="en" href="https://nameofmysite/example/en/">
{/block}`
I just want everything to work properly without any issues.

Avoid mobile devices responsiveness Wordpress Elementor

I have tried different solutions found in the web but with no success. I have tried already to remove the string from the file header.php but nothing happened.
The client wants the website to look exactly the same as the desktop version in all the mobile devices, so I have to delete what makes responsive my theme.
I'm using the theme "Twenty Twelve" from Wordpress and Elementor as visual editor.
Does anyone know how I can reproduce this? Thanks in advance for your help!
You need to remove Viewport meta tag from the header file check below
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Change Mobile & Tablet Breakpoints
You can set the mobile and tablet breakpoint values.
Go to Elementor > Settings > Style Tab, and set the breakpoint value for mobile and tablet
Save your changes
Go to Elementor > Tools > General Tab > Regenerate CSS, click Regenerate Files
set the breakpoint value = 0
change initial-scale=1.0 to initial-scale=0 in meta tag

Replacing TinyMCE fonts within WordPress editor - default fon't won't go away

I'm trying to replace the list of available fonts shown in WordPress' editor so that it only shows relevant fonts for the site, but even though I only include two custom fonts in the list the default one still shows up, that being "Georgia".
However, it's weird that it doesn't show up as a "selectable option", as in, it's the first option, but doesn't show in the actual dropdown.
My code:
add_filter('tiny_mce_before_init', 'blm_load_custom_fonts');
function blm_load_custom_fonts($init) {
$init['font_formats'] = 'Poppins=Poppins, sans-serif;Tex Gyre Adventor=Tex Gyre Adventor, sans-serif';
return $init;
}
Here is what I see:
How can I get rid of Georgia and make "Poppins" the default?
When you load content into TinyMCE that select list will show the font in use where the cursor is located. If you click to see the content of the select list that should only show you the fonts you have configured to be an option.
It is hard to tell from your screenshot but it looks like the default text in the editor is indeed Georgia font?
This is how TinyMCE works and you can't disable that behavior.
UPDATE: To address your question on the "default" font. I would suspect WordPress allows you to determine the default font in use while creating content.
There is a configuration setting for TinyMCE called content_css that allows you to pass in CSS that determines how things are rendered. Guessing WordPress already uses some sort of CSS (possibly theme related) that you would need to modify to change the default.

How to force LTR direction in wordpress with rtl language seleted

I have a wordpress site and iam using rtl enabled theme
So when i choose the main language of wordpress as "arabic"
The theme changes automatic to rtl
Is there any way to force it not to change direction even with Arabic language selected in wordpress dashboard??
RTL is done through CSS. When you use a theme it has styles such as float:right on certain elements so that that element goes to the right site. Or other CSS styles such as text-align: right. It depends on what element of the theme such as navigation, text, widgets, icons. They all will have and need different styles.
Therefore your question is impossible to answer.
Especially if you did not provide any code examples, screenshots or links.

Add Custom style on magento cms>page

How i can add the custom style to perticular pag in magento like :
I want to know how we can add style tag in page editor
You can add your custom stylesheet for cms page.
just do this in your cms page open design tab and in layout update xml field just add this code
<reference name="head">
<action method="addCss">
<stylesheet>css/your.css</stylesheet>
</action>
</reference>
Hope this will help you
So ran into this same issue, I needed it to allow the customer to adjust a few values with a media query depending on the edits of the content.
Simply place empty comments at the start and end of your style and TinyMCE will not add it's own.
e.g.:
<style type="text/css" scoped><!-- -->
p{color:red;}
<!-- --></style>
This is valid at least with Magento v1.9.1
Since adding <style> tag directly is not working, you can use javascript instead.
If youe theme is using jQuery, you may do it this way (concat the style tag so editor will not mark it as comment):
jQuery('body').append('<sty'+'le>'+'#header{margin:10px 0 0 0;}#morestylehere{display:inline}'+'</sty'+'le>')
Make sure it's enclosed with <script> tags.
Click on Show/Hide editor and you will be able to edit HTML source directly so you can add a style tag there
#Max unfortunatelly, tinyMCE will convert style tags to html comments. And after each modification of CMS page you should take care of replacing html comments back to style tags - this is not very good approach.
So, my suggestion is to use specific CMS page class name, that is being added to body tag.
You can go to your CMS page, and take a look at source code of the page to find this class name.

Categories