Title: the_weekday
Published: April 25, 2014
Last modified: February 24, 2026

---

# the_weekday()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#wp--skip-link--target)

Displays the localized weekday for the post.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#source)󠁿

    ```php
    function the_weekday() {
    	global $wp_locale;

    	$post = get_post();

    	if ( ! $post ) {
    		return;
    	}

    	$the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );

    	/**
    	 * Filters the localized weekday of the post, for display.
    	 *
    	 * @since 0.71
    	 *
    	 * @param string $the_weekday
    	 */
    	echo apply_filters( 'the_weekday', $the_weekday );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/general-template.php#L3118)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/general-template.php#L3118-L3137)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#hooks)󠁿

 [apply_filters( ‘the_weekday’, string $the_weekday )](https://developer.wordpress.org/reference/hooks/the_weekday/)

Filters the localized weekday of the post, for display.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#related)󠁿

| Uses | Description | 
| [get_post_time()](https://developer.wordpress.org/reference/functions/get_post_time/)`wp-includes/general-template.php` |

Retrieves the localized time of the post.

  | 
| [WP_Locale::get_weekday()](https://developer.wordpress.org/reference/classes/wp_locale/get_weekday/)`wp-includes/class-wp-locale.php` |

Retrieves the full translated weekday word.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_post()](https://developer.wordpress.org/reference/functions/get_post/)`wp-includes/post.php` |

Retrieves post data given a post ID or post object.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#changelog)󠁿

| Version | Description | 
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/the_weekday/?output_format=md#comment-content-1526)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/the_weekday/#comment-1526)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_weekday%2F%23comment-1526)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_weekday%2F%23comment-1526)
 4. **Displays the day of the week on which the currently looped posts have been published.**
 5.     ```php
        <p>This was posted on a <?php the_weekday() ?>.</p>
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_weekday%2F%3Freplytocom%3D1526%23feedback-editor-1526)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_weekday%2F)
before being able to contribute a note or feedback.