=== Tate ===
Contributors: kengen
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A theme set entirely in vertical writing, for Japanese and Chinese. The page unrolls to the left like a scroll.

== Description ==

Tate lays out every page in vertical writing (`writing-mode: vertical-rl`): lines run from top to bottom and follow each other from right to left, and the page scrolls to the left, like a hand scroll. It is always vertical — whatever the site language, and with or without the “日本語縦” (ja-tate) plugin, which makes the admin vertical too.

* A band along the right edge holds the site title, the menu, search and a dark/light switch. On a low window (a band up to 42.5rem high, 680 px, below the admin bar: a phone turned sideways, or a low laptop window) the band has two columns: the site title and the menu, then search and the switch. The site title is never shortened or cut: the subtitle and the menu wrap into further columns first, and a title longer than half the band wraps too, so that search and the switch stay inside the window. The menu is one level deep: items below the first level are not shown.
* On a post or a page, breadcrumbs run down a column along the left of the band, from the height of the site title: home, the post's main category with its parents (or the page's parents), and the title. A trail too long for the band's height wraps into a further column, and the band widens with it (up to four columns; beyond that the column scrolls sideways).
* A post, a page and their comments run as long as the text's line (44em) and sit in the middle of the window's height, with the same room above and below, as a scroll is held; in a lower window they take its whole height.
* The front page is a garden of cards: top to bottom, then to the left. Each card is one link and shows the excerpt as plain text.
* After a post, up to six related posts are shown as the same cards: the newest posts of the post's main category (the one its breadcrumbs show) and of its child categories. In the Customizer you can relate them by tags instead, and change their number and heading. A child theme can change the query with the `tate_related_args` filter (return an empty array for none). When Jetpack's Related Posts module is active, the theme shows none of its own.
* A post that was modified on a later day than it was published shows the date of that change after its date (“Updated”); the `tate_show_modified` filter changes this.
* Once the reader is a screen into the scroll, a small “Back to the start” button appears at the bottom left of the window (a touch screen has no Home key); it takes the page back to its start, as Home does.
* Numbers of one to four digits in running text are set upright (縦中横), and short Latin words of two to four letters with a capital in them (URL, CSS, Tate, Web, iOS) stand upright, letter by letter, next to Japanese; longer and lower-case words lie sideways, and so does a word joined to others (Pz-LinkCard, Node.js). A number joined to other letters or digits by `.`, `,`, `:`, `/` or `-` (16.10.2026, 3:29, 1,000) stays sideways with them, so that one number is never half upright.
* Core blocks are drawn vertically: a Details block opens to the left (its marker turns with the text), a Pullquote has its rules on the right and the left, Buttons are ink on paper (unless you pick colours), Social Icons are not indented like a list, a Separator is a short rule down the middle of the line (the wide style: the whole line; a plain `<hr>` keeps the browser's own rule), and a Verse block is a poem in vertical columns, its lines as you broke them. Citations are upright, not italic.
* Tables are vertical too: each row becomes a column, read top to bottom, the rows from right to left, with 縦中横 numbers in the cells. Code and embeds stay horizontal in small boxes inside the vertical page. The theme reads the text as a browser does (with WordPress's HTML API): its upright cells and boxes go between the tags, and no tag, attribute value or comment is changed. An embed with an aspect ratio (a YouTube block, say) is shown in a box of its own, at most 40rem wide, and keeps its ratio. A post of the same site whose URL stands alone on a line is shown as a vertical card like those of the front page — picture, title, date, excerpt and the site's name — printed in the text itself (no frame, as in the classic editor's view of it), from the post as it is now; embeds of other sites stay as they are. When another site embeds a post of this one, it gets the same card in WordPress's embed frame. Links in the text are underlined with a line of at least 3:1 contrast. The same boxes and upright numbers are made in the text, custom HTML, block and calendar widgets of the colophon, and in posts that a script loads from the site's pages (infinite scroll through admin-ajax.php; filter `tate_ajax_from_site`).
* Dates follow the site's date format; with the ja-tate plugin you can choose Japanese era years (令和8年9月25日) or kanji numerals (二〇二六年9月25日, 令和八年十月廿三日). Without the plugin, a format that uses symbols PHP does not know (the plugin's own) is not printed as letters: on a Japanese site the date falls back to “Y年n月j日” and the time to “G時i分” (the saved setting is not changed), elsewhere to WordPress's default. The year in front of 年 is set in kanji numerals, on a Japanese site and on a Chinese one (二〇二六年; the filter `tate_kanji_years` turns this on or off).
* The mouse wheel and the Page Up/Down, arrow, Space, Home and End keys scroll the page sideways (a part of the page that handles the wheel itself is left alone). Back, forward and reload bring the page back to where it was; a link opens a page at its start.
* Keyboard: a skip link leads to the text (it shows over the site title, not over the text), Tab brings every link into view as it moves along the page (the button back to the start is the last stop, after the colophon), and the dark/light switch is a button named after what it does (Dark, or Light while the page is dark).
* Printing gives vertical pages: the band, forms, navigation, related posts and the button back to the start are left out, colours are those of paper (buttons and social icons keep theirs), pictures, cards, boxes and buttons are kept whole on a page, and a link with an absolute URL is followed by that URL. Tables and code are printed without inner scrolling; a listing taller than the paper, or a table row of more cells than fit down the page, is cut at the bottom.
* Settings: Appearance › Customize › “Vertical theme” turns the related posts, the modified date, the button back to the start and the breadcrumbs on or off (all on by default), and sets how related posts are chosen (category or tags), their heading and their number (2 to 12, 6 by default). The card of a post of this site can be turned off (the post's title as a link instead) and shows, as you choose, the site title or its domain or neither, the published or modified date or none, and its picture at the top, at the bottom or not at all; its link can open a new tab. They are theme mods (the option `theme_mods_tate`); the defaults are the theme as it comes. A child theme still has the last word through the filters `tate_show_related`, `tate_related_args`, `tate_show_modified`, `tate_show_back_to_start`, `tate_show_breadcrumbs` and `tate_breadcrumbs`. The Customizer itself is vertical with the ja-tate plugin.
* Generic font families only (serif and sans-serif), so the reader's browser settings are respected. No external requests.

== Image sizes ==

In vertical writing a picture in the text is bounded by its height: the line runs from top to bottom (792 px at most).

* Recommended setting: in Settings › Media, give the medium size a max width of 1024 and a max height of 384 (a little less than half of the longest line). A photo aligned left or right sits at the top or bottom of the line in vertical writing; insert it at the medium size, so that it takes about half the line and leaves the other half to the text beside it (a landscape 4:3 photo becomes 512×384, a 3:2 one 576×384, a portrait one 288×384, and a panorama stops at 1024 px wide). At 384, a 4:3 medium picture on a screen of twice the density is served the large copy (1024 px) rather than the uploaded image. Insert a large photo with the alignment “None”: it takes the whole line. The theme does not change the setting; it applies to images uploaded afterwards, and images uploaded before keep their medium copy.
* On screen, a picture aligned left or right (other than a large one) is at most half the line long, whatever its size: on a lower window, where the line is shorter, it is made smaller with the line, and its `sizes` say the same. The line is that of the text, also for a picture in a paragraph set in larger characters. A picture resized in the block editor keeps its proportions (its width is made smaller with its height). Pictures that are not aligned, and large ones, keep the whole line. On paper the line is as long as the page, and aligned pictures keep their size (the size they have in a full line, at most the page's width), whatever the screen the page is printed from; a picture cropped to another aspect ratio in the block editor keeps that ratio. The theme writes two custom properties into the style of these pictures, `--tate-width` and `--tate-ratio`; the same names written by hand in a picture's style are removed.
* “Large” is fitted to the longest line by its height (792 px): a landscape 4:3 photo is inserted as 1024×768, a portrait one as 594×792. A large picture that is aligned all the same stands alone on screen, at the start or end of the line, since it would leave no room for text beside it; otherwise it takes a line of its own. A picture with a caption leaves room beside it for a column of the caption.
* The `sizes` attribute describes the vertical layout: a picture is as tall as the line allows and never wider than the scroll, so a phone shows it whole. On the front end, pictures placed in the text get no `sizes="auto"` (their box follows the file chosen); gallery tiles and cards keep it.
* Copies of an uploaded image: the theme adds tate-card (480×360, cropped, for the cards on the front page). Which other copies are made is data that stays in the media library after the theme is switched, so the theme leaves it to the “日本語縦” (ja-tate) plugin: it asks for fewer copies (the `'image-sizes' => 'fewer'` argument of `add_theme_support( 'ja-tate-vertical', … )`, given in one call with `'admin-bar' => 'side'` and `'media-player' => 'vertical'` (the last asks the plugin to open the theme's player box, `.masu-media`, when it turns the player vertical): a second call would replace the first), and with the plugin active, thumbnail, medium and large are made (the sizes in Settings › Media), but not medium_large (768), nor 1536x1536 and 2048x2048 for an image of 2560 px or less on its longer side; high-density screens are offered the uploaded image itself instead. See the plugin's readme. Without the plugin, WordPress makes its usual copies.
* The theme neither deletes nor remakes copies. A picture in an older post is shown at most at the width and height it was inserted with (e.g. 720×540), and smaller where the line or the screen is shorter.
* To give images uploaded before the tate-card copy, use `wp media regenerate --image_size=tate-card --only-missing`, which adds that copy and keeps the others. With the plugin active, plain `--only-missing` rebuilds the list of copies of every image that lacks one: for an image of 2560 px or less, medium_large, 1536x1536 and 2048x2048 are dropped from it, and their files stay on disk unlisted (deleting the image leaves them behind).
* After switching to another theme, or deactivating the plugin, images uploaded with fewer copies have no medium_large, 1536x1536 and 2048x2048 copies. Those wider than 2048 px (a landscape photo of 2560×1920, say) are then no longer offered whole, so high-density screens get at most the large copy (1024 px) until these copies are made; narrower ones (a portrait photo of 1920×2560) still offer the image itself, as WordPress lists images up to 2048 px wide. To make the copies: `wp media regenerate --image_size=2048x2048 --only-missing`, and the same with 1536x1536 and medium_large. Plain `--only-missing` makes them too, but after a switch of theme it drops tate-card from the list of copies (its files stay on disk unlisted).

== Typesetting classes ==

For books and long texts (for instance a work converted from Aozora Bunko), the text of a post can use these classes in its HTML:

* Emphasis dots (圏点, 傍点): `<em class="kenten">…</em>` puts a filled sesame mark to the right of each character (the em is upright, not italic); the marks take the colour of the text. Other marks go with it: `kenten-shirogoma` (open sesame), `kenten-maru` (filled circle), `kenten-shiromaru` (open circle), `kenten-kurosankaku` (filled triangle), `kenten-shirosankaku` (open triangle), `kenten-nijumaru` (open double circle) and `kenten-janome` (filled double circle), as in `<em class="kenten kenten-maru">…</em>`.
* Indent (字下げ): `jisage-1` to `jisage-10` on a paragraph or a block (`div`) starts it that many characters below the top of the column, and its wrapped lines too. The theme indents every paragraph by one character; a paragraph with a `jisage` class has no other indent, and `jisage-0` is a paragraph that starts flush with the top (one that opens with 「, say). The paragraphs in a block keep their own indent.
* Flush to the end (地付き): `chitsuki` sets a paragraph or a block at the bottom of the column; `chiage-1` to `chiage-10` leave that many characters free below it (「地から N 字上げ」).
* Headings: `h2`, `h3` and `h4` in the text get one size smaller each; `h4` is the smallest.
* Boxes: `kakomi` on a `div` (or a paragraph) frames it on light paper; `kakomi-chui` (caution) and `kakomi-memo` (note) add a thick rule on its right, vermilion or light ink, with a mark at the top (！ or ※). In the classic editor they are in the Formats list, which wraps the selected paragraphs; in the block editor they are styles of the Group block (Box, Box: caution, Box: note; the classes `is-style-kakomi` …).
* Side lines (傍線): `bosen` on a `span` draws a vermilion line to the right of its characters, `bosen-nami` a wavy one, `bosen-nuri` tints the right half of the column like a marker pen, and `aka` sets the characters in vermilion. `kbd` is drawn as a key. The classic editor's Formats list offers them all; in the block editor, use the core Highlight. The theme adds only these classes: with another theme the text is plain again.
* The title of an archive page (a category, a tag, an author, a month) is the name alone, without the prefix WordPress gives it ("Category:").

== Frequently Asked Questions ==

= Where is the menu? =

Assign a menu to the location “Band (right edge)” in Appearance › Menus. A second location, “Colophon (end of the page)”, is shown at the end of the page, together with the “Colophon” widget area.

= Which category do the breadcrumbs show? =

The post's main category, from its top parent down. With Yoast SEO, that is the category chosen with "Make primary" in the post's categories box; without it, or when none is chosen (or the chosen one was taken off the post), it is the first of the post's categories. A child theme can change it with the `tate_primary_category` filter (return a category, its ID, or null for none), and the whole trail with `tate_breadcrumbs`. Breadcrumbs appear on posts and pages only, not on the front page, lists, search or the not-found page, and they are not printed. The theme prints no structured data for them: Yoast SEO has a BreadcrumbList of its own in its schema (which categories it lists follows Yoast's own breadcrumb settings).

= How are Pz-LinkCard's cards laid out? =

As vertical cards. Pz-LinkCard's settings are read as its settings page shows them in a vertical admin, turned a quarter to the right: the width is the card's length down the line, an outer margin at the top is the margin at the right (and so on round), Centering puts the card in the middle of the line, no outer margin at the right puts it at the bottom, and a thumbnail on the right sits at the bottom of the card from edge to edge (on the left: at the top).

= What happens to a long trail? =

It is never cut short. It wraps into another column, and the band, the page and the pictures' limits make room for it (the theme's script measures the trail). Past four columns, or without the script, the trail's column scrolls sideways; a link reached with the Tab key is brought into view.

= Does it work for Chinese? =

Yes, Traditional and Simplified alike. The page is the same, and the site language sets the `lang` of the page, so the browser picks the reader's Chinese serif font and its vertical punctuation. Paragraphs are indented by two characters (首行缩进两字; Japanese ones by one), years in dates are written in kanji numerals (二〇二六年), and dates otherwise follow the site's date format. The theme's own words (Search, Dark, Related posts …) are translated at translate.wordpress.org.

= Can I use it for horizontal languages? =

The layout is always vertical. Latin text is set sideways in the vertical lines, as in Japanese books.

= What happens with a right-to-left site language? =

The lines still run from top to bottom and follow each other from right to left: the theme keeps the text direction left-to-right, which is what vertical Japanese needs. Only the admin bar follows the language.

= Does a lightbox work? =

A PhotoSwipe 5 lightbox (for example the Lightbox with PhotoSwipe plugin) opens over the page and stays vertical: the counter and the caption are set in vertical lines, the caption as a column at the top left. The pictures follow each other to the left, as the page does: the arrow at the left edge and the ← key bring the next picture, the arrow at the right edge and → the previous one, and a swipe (or a drag with the mouse) to the right brings the next picture in from the left. The image block's own "Expand on click" lightbox works too. While a lightbox is open, the page underneath does not move, and it is where it was when the lightbox closes, also when the picture was only partly in view.

== Changelog ==

= 0.1.0 =
* First version.

== Copyright ==

Tate WordPress Theme, © 2026 豎舞台
Tate is distributed under the terms of the GNU General Public License v2 or later.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

== Resources ==

No third-party resources are bundled. screenshot.png shows a sample post written by the theme's author for the theme's demo; its picture is drawn by the theme's author (with PHP's GD functions).
