<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prayer Times Riyadh</title>
    <description>The latest articles on DEV Community by Prayer Times Riyadh (@prayertimes_riyadh_990e3b).</description>
    <link>https://dev.to/prayertimes_riyadh_990e3b</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4167076%2F88b6c7e9-c80b-4738-b455-6ab0e8a9c17b.png</url>
      <title>DEV Community: Prayer Times Riyadh</title>
      <link>https://dev.to/prayertimes_riyadh_990e3b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prayertimes_riyadh_990e3b"/>
    <language>en</language>
    <item>
      <title>How I built a bilingual prayer-times site for Riyadh (WordPress + Umm al-Qura API)</title>
      <dc:creator>Prayer Times Riyadh</dc:creator>
      <pubDate>Tue, 06 Oct 2026 17:48:56 +0000</pubDate>
      <link>https://dev.to/prayertimes_riyadh_990e3b/how-i-built-a-bilingual-prayer-times-site-for-riyadh-wordpress-umm-al-qura-api-2mb</link>
      <guid>https://dev.to/prayertimes_riyadh_990e3b/how-i-built-a-bilingual-prayer-times-site-for-riyadh-wordpress-umm-al-qura-api-2mb</guid>
      <description>&lt;p&gt;A friend in Riyadh once told me he kept three different apps on his phone just to double-check prayer times. Every app showed slightly different numbers, and nobody could explain why. That conversation became a side project: a single, trustworthy, bilingual website for Riyadh prayer times. The result is now live, and the build taught me a lot about astronomy math, Arabic typography, and pragmatic WordPress development. Here is the full story.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: prayer-time math is not one-size-fits-all
&lt;/h2&gt;

&lt;p&gt;Most people assume prayer times are simple lookup tables. They are not — they are astronomical calculations derived from the sun's position relative to a specific location. Fajr and Isha in particular depend on how far the sun dips below the horizon (the "twilight angle"), and different organizations use different angles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Muslim World League&lt;/strong&gt;: 18° for both Fajr and Isha&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ISNA (North America)&lt;/strong&gt;: 15° for both&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egyptian General Authority&lt;/strong&gt;: 19.5° / 17.5°&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Umm al-Qura (Saudi Arabia)&lt;/strong&gt;: 18.5° for Fajr, and a fixed 90-minute interval after Maghrib for Isha (120 minutes during Ramadan)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These small differences in angle translate into 10–20 minute differences on the clock. That is why my friend's three apps disagreed — they were silently using three different calculation methods. Picking the right method for the audience is the single most important decision in a prayer-times product, and everything else follows from it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Umm al-Qura is the standard for Saudi Arabia
&lt;/h2&gt;

&lt;p&gt;The Umm al-Qura calendar, issued by Umm al-Qura University in Mecca, is the official calculation method used across the Kingdom of Saudi Arabia. Mosques, newspapers, and government announcements in Riyadh all follow it. For a site serving Riyadh, using the Muslim World League or any other method would not just be slightly off — it would be visibly wrong compared to every mosque loudspeaker in the city.&lt;/p&gt;

&lt;p&gt;One quirk worth knowing: Umm al-Qura computes Isha differently from most methods. Instead of a twilight angle, it uses a fixed time interval after Maghrib — 90 minutes on ordinary days, 120 minutes during Ramadan. If you hard-code an angle for Isha, your Saudi timetable will be wrong year-round. Getting this detail right was non-negotiable for the site's credibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack: WordPress plus a small custom layer
&lt;/h2&gt;

&lt;p&gt;I chose WordPress as the foundation, for boring and practical reasons: mature SEO tooling, a real content editor for the bilingual articles we planned, and cheap, reliable hosting. But WordPress alone does not compute prayer times, so I added a small custom layer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data source&lt;/strong&gt;: The site's daily times come from a scheduled job that calls the Aladhan API with the Umm al-Qura method parameter for Riyadh's coordinates (24.7136° N, 46.6753° E). The response is cached as transients and stored as structured meta, so the site never hits the API on a page view.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-checking&lt;/strong&gt;: Automated checks compare the fetched times against a second independent implementation of the Umm al-Qura rules. If Fajr or Isha ever drift by more than a couple of minutes, I get an alert before visitors see anything wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Presentation&lt;/strong&gt;: A lightweight custom theme block renders the day's timetable, the Hijri date, and a "next prayer" countdown. No page builder, no 2 MB slider plugin — just server-rendered HTML.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Keeping the custom code small was deliberate. Prayer-time logic is the kind of thing that rots quietly if it is buried inside a giant theme; isolating it in one plugin made the cross-checks and caching easy to reason about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bilingual challenges: RTL Arabic and text shaping
&lt;/h2&gt;

&lt;p&gt;Half the audience reads Arabic, half reads English, and both halves deserve a first-class experience. Two problems were harder than expected:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RTL layout.&lt;/strong&gt; Arabic pages use &lt;code&gt;dir="rtl"&lt;/code&gt;, and I learned to stop writing &lt;code&gt;margin-left&lt;/code&gt; / &lt;code&gt;margin-right&lt;/code&gt; and use CSS logical properties (&lt;code&gt;margin-inline-start&lt;/code&gt;, &lt;code&gt;padding-inline-end&lt;/code&gt;) everywhere instead. Iconography that implies direction — arrows, progress indicators, the prayer timeline — has to be mirrored, not just translated. The timetable table itself reads right-to-left in Arabic, which changes column order, not just text alignment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Arabic text shaping in share images.&lt;/strong&gt; We auto-generate Open Graph images for each day's timetable. The first version rendered Arabic with disconnected letters — each glyph drawn in its isolated form — because the image renderer had no complex-text-layout engine. Arabic script requires contextual shaping (letters join depending on neighbors) plus proper right-to-left ordering. The fix was switching the rendering pipeline to a text stack with real shaping support, and then visually reviewing a sample of generated images in both languages before shipping.&lt;/p&gt;

&lt;p&gt;A smaller detail: numerals. Some Arabic-speaking visitors expect Eastern Arabic numerals (٠١٢٣٤٥٦٧٨٩), others are used to Western digits. We made it a toggle rather than guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  SEO and performance notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Precompute, don't calculate.&lt;/strong&gt; Every day's timetable is generated once and served as static cached HTML. A month view is a single query against stored data, not 30 API calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One URL per language.&lt;/strong&gt; The English edition lives at &lt;code&gt;/en/&lt;/code&gt; and the Arabic edition at the root, each with proper &lt;code&gt;hreflang&lt;/code&gt; annotations so search engines do not treat them as duplicates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured data and sitemaps.&lt;/strong&gt; Separate sitemaps per language and schema markup for the daily schedule help the pages show up as rich results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Core Web Vitals.&lt;/strong&gt; Server-rendered HTML, system font stacks with an Arabic-capable fallback, lazy-loaded images, and no render-blocking JavaScript kept Largest Contentful Paint comfortably in the green on mid-range phones — which is what most of the audience actually uses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The finished product
&lt;/h2&gt;

&lt;p&gt;After about six weeks of evenings, the site was doing exactly what I had promised my friend: one page, the right times, in the language he reads. You can see the finished result on the &lt;a href="https://prayertimesriyadh.com/en/" rel="noopener noreferrer"&gt;live site&lt;/a&gt; — the English edition, with the Arabic edition one click away.&lt;/p&gt;

&lt;p&gt;The biggest lesson was not technical. Accuracy is the product here: a beautiful timetable computed with the wrong method is worse than an ugly one computed with the right method. Choosing Umm al-Qura, verifying it with cross-checks, and presenting it bilingually is what makes the site worth using — the WordPress plumbing is just how it got shipped.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>api</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
