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

---

# the_weekday_date( string $before, string $after )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#changelog)

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

Displays the localized weekday for the post.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#description)󠁿

Will only output the weekday if the current post’s weekday is different from the
previous one output.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#parameters)󠁿

 `$before`stringoptional

Output before the date. Default empty.

`$after`stringoptional

Output after the date. Default empty.

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

    ```php
    function the_weekday_date( $before = '', $after = '' ) {
    	global $wp_locale, $currentday, $previousweekday;

    	$post = get_post();

    	if ( ! $post ) {
    		return;
    	}

    	$the_weekday_date = '';

    	if ( $currentday !== $previousweekday ) {
    		$the_weekday_date .= $before;
    		$the_weekday_date .= $wp_locale->get_weekday( get_post_time( 'w', false, $post ) );
    		$the_weekday_date .= $after;
    		$previousweekday   = $currentday;
    	}

    	/**
    	 * Filters the localized weekday of the post, for display.
    	 *
    	 * @since 0.71
    	 *
    	 * @param string $the_weekday_date The weekday on which the post was written.
    	 * @param string $before           The HTML to output before the date.
    	 * @param string $after            The HTML to output after the date.
    	 */
    	echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
    }
    ```

[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#L3154)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/general-template.php#L3154-L3182)

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

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

Filters the localized weekday of the post, for display.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/the_weekday_date/?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_date/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/the_weekday_date/?output_format=md#)

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

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

## User Contributed Notes

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