contacts

Buy All 118 Premium WordPress Themes for $59.99
No Additional Fees, Pay Once and Use Unlimited Time for Unlimited Domains, Free Lifetime Updates

How to Change the Start of the Week in the Premium tYoga Theme

The Premium tYoga Theme is a versatile and feature-rich WordPress theme designed for yoga instructors, studios, and fitness enthusiasts. One of the unique features of this theme is the class scheduling system.

However, some users have noted that the default schedule starts the week on Sunday. If you’re from a region where the week traditionally starts on a Monday, or if you simply prefer it that way, you might want to tweak this setting.

Please note that the provided theme code doesn’t support changing the start of the week directly. To accomplish this change, you’ll need to alter the theme’s code slightly. Here’s how:

Prerequisites:

  1. Make sure you have access to your WordPress files. This could be via FTP, cPanel, or directly from the WordPress dashboard if you have a file editor plugin installed.
  2. Consider creating a backup of your existing tyoga/single-class.php file just in case.

Steps:

Step 1: Locate the Theme File

  • Navigate to your WordPress theme directory and locate the tyoga theme.
  • Inside the tyoga theme folder, find the file named single-class.php.

Step 2: Open the File for Editing

  • Open single-class.php using a text editor if you are doing this locally, or use the file editor in your cPanel or WordPress dashboard.

Step 3: Locate the Schedule Code Block

  • Scroll down or search within the file to find the line that reads:
ksort($schedule);
  • This line sorts the days of the week starting from Sunday.

Step 4: Insert Custom Code

  • Add the custom PHP code snippet right above the ksort($schedule); line. Here’s what you need to insert:
// Reorder the days to start from Monday
$new_order = array(1, 2, 3, 4, 5, 6, 0);
$new_schedule = array();
foreach($new_order as $index) {
    if (isset($schedule[$index])) {
        $new_schedule[$index] = $schedule[$index];
    }
}
$schedule = $new_schedule;

Your code should now look something like this:

// Reorder the days to start from Monday
$new_order = array(1, 2, 3, 4, 5, 6, 0);
$new_schedule = array();
foreach($new_order as $index) {
    if (isset($schedule[$index])) {
        $new_schedule[$index] = $schedule[$index];
    }
}
$schedule = $new_schedule;

Step 5: Save Changes

  • Save the changes to the single-class.php file.

Step 6: Upload the Modified File

  • If you made these changes locally, upload the modified single-class.php file back to the tyoga theme folder in your WordPress directory.

Step 7: Clear Cache and Test

  • Clear your website cache if you’re using any caching plugins, then visit your website to see if the schedule now starts from Monday.

Step 8: Confirm Changes

  • Make sure to review your class schedule to confirm the week starts on Monday as expected.

That’s it! You’ve successfully changed the start of the week in your Premium tYoga Theme. If you encounter any issues, simply revert to the backup file you created earlier and try again.

Leave a Reply