Changing fonts for languages that are read from right to left in WordPress

I am currently working on a WordPress site that features posts in both English and Urdu. The English posts are written from left to right (ltr), while the Urdu posts are written from right to left (rtl). When I submit post data in the wp editor, it publishes correctly.

My goal is to have a specific Urdu font (Mehr Nastaliq) applied to my Urdu language posts, while keeping the theme default fonts for the English posts. Can you please provide guidance on how to achieve this?

Thank you very much in advance!

Answer №1

For any elements that will display Urdu text, make sure to assign a distinct CSS class.

.urdu-text {
  direction: rtl;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Text in a website displayed in a 3D perspective fashion

Is there a way to create 3D text effects with perspective using a combination of Javascript and CSS? I am open to suggestions that involve the use of external libraries for Javascript or CSS as well. ...

Parent menu fails to trigger the opening of child menu upon clicking

I'm struggling to modify a Wordpress theme to enable the child menus to expand when clicking on the parent menus. Is there a way to edit this code to make that functionality work? // Implement expandable menus var expand_link = $('<a class="m ...

Please include text beneath the input group addon class

Hey everyone, I'm facing some issues with my layout. Whenever the input fields are empty or null, I encounter errors. I want to ensure that the input text and input group addon have equal heights. Also, upon clicking the submit button, I use jquery/aj ...

The img:first-of-type selector targets specifically the first image within a group

When a user visits my website using a touch device or without Javascript support, I want the first of two images to display. To achieve this, I am targeting them using Modernizr. The menu button at the top of the page: <img src="menubutton.png" alt="M ...

"Divs of the same type automatically adjust size to fit within the

I am currently exploring the possibility of creating a versatile component that can be customized based on the needs of its parent element, whether through bootstrap or traditional flexbox / CSS grid. I want to determine the level of reusability this compo ...

What is the best way to merge multiple window.onscroll events together?

One feature is a colorful RGB scroller positioned next to the standard scrollbar, indicating the progress of page scroll. The second feature is a classic "scroll to top" button. FIRST FEATURE HTML <button onclick="topFunction()" id="myB ...

Designing GWT FlexTable using pure CSS styling

Is there a way to style a GWT FlexTable using CSS alone? The API doesn't provide information on available CSS classes. Are there no predefined classes and do I need to define them myself? I am particularly interested in styling the "th" element. ...

What is the functionality of {all: initial} and how does it address issues with default values?

Why do paragraphs inherit properties like line-height and text-align from the div element? If values for these properties are: normal -> for line-height [i.e. font-size = 16px (initial / default value) * normal (value is usually around 1.2 -> 19.2 ...

Anchor elements and other inline elements not triggering MouseLeave event

Take a look at this CodePen link, particularly in Chrome: https://codepen.io/pkroupoderov/pen/jdRowv Sometimes, the mouseLeave event doesn't trigger when a user quickly moves the mouse over multiple images. This results in some images still having t ...

Text Appearing in Bold Typeface

It's strange that the text below the "Support Us" section is showing up in bold. I tried changing the font style to normal, but it's still bold. The JSFiddle layout may appear messy, but if you scroll right, you'll see the issue. http://jsf ...

Using pagination with tables in HTML: A beginner's guide

I attempted to implement a paging system within a table following the instructions in this article, but unfortunately, it doesn't seem to be functioning correctly. Expected Output: https://i.sstatic.net/4ODNf.png Current Output: https://i.sstatic. ...

Initiate the printing process by executing the window.print() function. As the document is being

Here's the code snippet : <body> <div class="headerCont noprint"> <div class="headerHold"> <div class="logoCont"><img src="images/logo.jpg" width="104" height="74" alt="Logo"> ...

Conceal the footer when the website is scrolling, reveal it when the website is not scrolling

Before I pose my question, I need to establish two constraints: Must be compatible with IE 7+ Only able to modify the CSS, cannot adjust the HTML/JS So, I have two divs: <div id="content"></div> <div id="footer"></div> "#conten ...

Styling elements with CSS can sometimes lead to unexpected behavior in Safari on iOS devices, especially

Ever since the release of iOS 14, I've noticed that content within a div element with an 'overflow-y: scroll' property no longer functions properly on Safari. Does anyone happen to have a solution for this? (Or maybe my code just needs some ...

Creating a div that overlays other divs using html and css

On websites like Facebook and LinkedIn, there is a search box where you can type in your query and the results will display below it, covering up other content on the page. This functionality is shown in the screenshot below from LinkedIn. I am curious ab ...

Is there a way to remove the jQuery .css() upon clicking a different button?

I am currently working on a jQuery switch where I want the clicked button to revert back to its original state when another button is clicked. Additionally, I want the 'OFF' button to be automatically clicked first when the page loads. Despite tr ...

Vue.js displaying incorrectly on Windows Server 2019 IIS post deployment

Once I run npm serve, everything runs smoothly. However, when I deploy my app with an API in an ASP.NET application, it doesn't scale properly. I am using Router and History for navigation. Anonymous user authentication is enabled and static content h ...

Master the Art of Image Loading in Codeigniter

Hey there, I'm completely new to Codeigniter. In the Controllers folder, I've created a file called caller.php and in the \Views directory, I've created a file named home1.php. Additionally, within the root directory, I've made an ...

Revising the hierarchy between !important in CSS and jQuery

(Attempting to modify CSS properties within a Chrome extension content script) Is it feasible to override CSS properties that have been marked as !important on the webpage? For example, if I aim to eliminate an important border: $(".someclass").css(&apo ...

Issue with functionality of inline list menu

Having trouble with a JQ drop down menu and suspect it's an HTML/CSS issue. Spent hours tweaking it, but still not working as expected. Looking to understand the correct approach rather than just getting it to function. The slidetoggle feature is mess ...