Skip to content

Fix ?format=markdown for static front pages#36

Open
ilicfilip wants to merge 2 commits intomainfrom
filip/fix-static-front-page-format-markdown
Open

Fix ?format=markdown for static front pages#36
ilicfilip wants to merge 2 commits intomainfrom
filip/fix-static-front-page-format-markdown

Conversation

@ilicfilip
Copy link
Copy Markdown
Contributor

Summary

  • When a site uses a static front page (Settings > Reading > "A static page"), ?format=markdown on the home URL returned the blog post listing instead of the front page content
  • The is_singular() check in handle_format_parameter() fails because the extra ?format= query var prevents WordPress from recognizing the request as singular
  • Added fallback detection: when is_singular() is false and the site has a static front page configured, check is_front_page() / is_home() and resolve via page_on_front option

Closes #35

Test plan

  • curl "http://site.test/?format=markdown" returns static front page content (not blog listing)
  • curl "http://site.test/sample-page/?format=markdown" still works for regular pages
  • curl "http://site.test/index.md" still works (unaffected .md URL path)
  • Sites without a static front page are unaffected

🤖 Generated with Claude Code

…e content

When a site uses a static front page, the ?format=markdown query parameter
caused WordPress to not recognize the request as singular, falling back to
the blog post index. Now detects the static front page via is_front_page()
and page_on_front option when is_singular() fails.

Closes #35

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Signed-off-by: Filip Ilic <ilic.filip@gmail.com>
@ilicfilip ilicfilip marked this pull request as ready for review April 2, 2026 11:38
@ilicfilip ilicfilip requested a review from jdevalk April 2, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static front page returns blog post list instead of page content with ?format=markdown

1 participant