=== TRIS Theme === Contributors: Tim Reeves Author URI: https://timreeves.de/ Theme URI: https://timreeves.de/ Tags: minimalistic, translation-ready Copyright: 2021 - 2026 Tim Reeves Requires at least: 5.0 Tested up to: 7.0 Stable tag: 1.47 == Description == TRIS Theme is an *extremely* minimalistic theme, which supports customization only via PHP and CSS. Its layout is: Header, Navi bar, Content + right sidebar, Footer. Navi bar becomes fixed on scroll. Custom HTML can be injected into the header. The menu, searchbox and sidebar can all be turned off. The standard footer content (Copyright, one menu intended for disclaimer, data privacy etc.) can be replaced with custom content (e.g. a widget area) via a PHP file. The theme has a fully responsive design for mobile devices (fixed at <=768px in theme css). On mobiles, the main menu mutates to a dropdown menu actioned by a hamburger icon; and the sidebar is offscreen right, and slides in when the Plus icon is tapped. WordPress commenting is fully supported using standard WordPress functions. The commenters IP addresses are stored anonymized (last parts masked to 0). Commenters avatars will be shown if that feature is enabled in WordPress settings. The theme only uses one very short JavaScript file (native JS, no jQuery). Pre-minified JS and CSS files are not provided, on the assumption a caching plugin will do that. Caching: HTML pages can always be minified including stripping of comment. Remember not to cache HTML pages if you have content which may change (e.g. latest posts). The sidebar, if not deselected, shows a dynamic_sidebar('Primary Sidebar'). The Navi bar displays a main menu called 'TRIS Menu', which must be present. The default footer displays a (small) menu 'TRIS Footer', which can contain e.g. Disclaimer, Data Privacy. Depending on viewport width, when the sidebar is hidden, the width of the main content area is often larger than when the sidebar is shown. This cannot be easily accounted for in CSS media width queries, which only work on viewport width, not the width of a particular container. To allow you to design CSS for the width of the main content area, the themes JS sets classes on #content on DOMReady and resize events as follows: o if (contentWidth >= 700) { content.classList.add('ge700'); } else { content.classList.add('lt700'); } o if (contentWidth >= 650) { content.classList.add('ge650'); } else { content.classList.add('lt650'); } o if (contentWidth >= 600) { content.classList.add('ge600'); } else { content.classList.add('lt600'); } o if (contentWidth >= 550) { content.classList.add('ge550'); } else { content.classList.add('lt550'); } o if (contentWidth >= 500) { content.classList.add('ge500'); } else { content.classList.add('lt500'); } o if (contentWidth >= 450) { content.classList.add('ge450'); } else { content.classList.add('lt450'); } o if (contentWidth >= 400) { content.classList.add('ge400'); } else { content.classList.add('lt400'); } TRIS theme provides the following template files - for more info on what WordPress expects and looks for to display a particular page type, see https://developer.wordpress.org/themes/basics/template-files/ and https://developer.wordpress.org/themes/basics/template-hierarchy/ and help/WordPress-Template-Hierarchy.png also https://wpmudev.com/blog/the-ultimate-guide-to-theme-template-files-in-wordpress/ o 404.php used by WP when no page found at the requested URL. Default action: redirects to home_url(). If $GLOBALS['404-action'] is NOT '301' then an own 404 page is displayed. Use 'search' to have the page include a search form. o attachment.php redirects to the image / video etc. parent page to avoid SEO problems o author.php redirects to home_url() to avoid SEO problems o comments.php displays comments including navigation therein o index.php fallback for a page of post excerpts (e.g. recent articles, tag, category) OR search results o page.php a single PAGE with featured image, comments and pagination within the one page o single.php a single POST with featured image, comments, pagination within the page, prev / next navigation Note that individual archive pages like category.php or tag.php are not offered (excepting author.php) - they fall through to index.php, which allows sharing common code. Currently only for tags and categories, all other taxonomies (e.g. date, month, day) are redirected to home_url() (for SEO). SO with TRIS theme no need to worry about date archives! Optional: Add a website-specific home.php if a special layout is required for the home page. TRIS Theme supports 'Featured image' (FI) for posts AND pages. On the page itself the FI is shown directly under the headline and in full #content width. The media size 'post-thumbnail' is used, lightbox-linked to the original image. On archive pages the media 'thumbnail' size is used, floated left with the excerpt on its right. For pages, you may also need to activate the display in the WP 'Screen Options'. Theme config also offers options to manage media sizes, including set_post_thumbnail_size and remove_extra_image_sizes. TRIS Theme includes some CSS to style the WP Featherlight lightbox plugin, and also to allow adding caption text which is hidden onpage but displayed in the lightbox - search style.css for "featherlight". Source Maps: are special files that connect that final output file the browser is actually using with the authored files that you actually work with and write code in on your file system. So, these source maps are for developers. So DON'T provide them in production. WP Featherlight: - Official last stable version was 1.3.4 (which didn't recognise WebP pictures) - I created a 1.3.5 from it which does recognise WebP (corrected typos, current is now 1.3.7) /home/tim/Zed/WordPress/Plugins/wp-featherlight/ + /home/tim/Zed/WordPress/2021-Setup/wp-featherlight.zip - On GitHub there's a younger version 1.7.14, which still doesn't recognise WebP - But also a master version (all latest mods) which does: https://github.com/noelboss/featherlight/tree/master - However, 'master' is NOT a plugin structure, just the code and testing for Featherlight itself - BUT wp-featherlight-master/{src|release}/ have the new versions which are in the plugins at /js/vendor/ Missing WebP? - Whereby .js are copyable, but .css looks rather different - try it out. - The new .js files add support for AMD and probably minor improvements / fixes. - The plugin loads (when minified used) ONLY: /css/wp-featherlight.min.css + /js/wpFeatherlight.pkgd.min.js - This is because 'pkgd' is the packaged version of /js/vendor/jquery.detect_swipe.js + /js/vendor/featherlight.js + /js/vendor/featherlight.gallery.js + /js/wpFeatherlight.js - All unchanged, except watch out for "webp" - wp-featherlight.css combines 'master' featherlight + gallery - but look rather different... keep the plugin version - REMOVE the pre-minified versions and let W3TC do it - then we can make an exception if need be. - CAREFUL: that would change to loading the four separate .js files, for max. compatibility. - OK, so modify (.webp) the four extra AND the pkgd version - Modified class-scripts.php::get_suffix() to not load minified versions - SO: Only changes in /css/wp-featherlight{.min}.css and /js/wpFeatherlight.pkgd{.min}.js will have an effect!!! - wp-featherlight-disabled or wp-featherlight? With elements from 'master'? - wp-featherlight-disabled is almost identical to my 1.3.5, has also added webp. wpFeatherlight.min.js is 1 byte diff length... - OOPS wpFeatherlight.pkgd.js (jquery.detectSwipe) also needs mod for WebP - he did, I didn't )-: - But in js/vendor/featherlight.js he missed it and I did not - but that's irrelevant, see above. - So I copied 'master' wpFeatherlight.pkgd.js to my Featherlight as Vn. 1.3.6 - 'disabled' does not deliver the languages available in the original - but there's nothing worth translating anyway - SO use either mine via upload, if many pages with pictures (default with WPFL) or 'disabled' if only few with pics. ACHTUNG: https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/wp-featherlight/multiple-plugins-various-versions-authenticated-contributor-stored-dom-based-cross-site-scripting-via-featherlightjs-javascript-library --- BIG problem with W3TC COMBINING pre-minified simple-comment-editing/dist/sce-editing.js - it's truncated to half its size! Also pre-minified simple-comment-editing/dist/integrations-admin.js - which is huge Performance > Minify > Advanced > Never minify the following JS files: wp-content/plugins/simple-comment-editing/dist/sce-editing.js wp-content/plugins/simple-comment-editing/dist/integrations-admin.js OR trip-content/plugins/simple-comment-editing/dist/sce-editing.js trip-content/plugins/simple-comment-editing/dist/integrations-admin.js AND JS only minify, NOT minify & combine Plugins to vamp up Commenting: o Comment Edit Core – Simple Comment Editing - Anonymous users can edit comments for 5 minutes. WP Cerber > Anti-Spam > Adjust anti-spam engine > Safe mode > ON (Allow AJAX) o Subscribe to Comments Reloaded - enables commenters to sign up for e-mail notifications. It includes a full-featured subscription manager that your commenters can use to unsubscribe to certain posts or suspend all notifications. Don't forget: StCR > Options > Enable on post types > Posts | Pages (check the required types) The theme uses a mix of highly efficient icons: - The hamburger (menu) and plus (sidebar) icons are pure CSS with transformations. - All triangles (open submenu, prev/next post links etc.) are also pure CSS constructions. - Other icons (tags, categories, magnifier etc.) are in a css sprite image (icons/css_sprites.png). - The icons used in the comments section are in a custom font of 20 icons created with fontello.com (*) (*) The font is not loaded in the theme's style.css, since not needed if comments are not allowed. Unless you like other icons in it... To see which icons it contains, doubleclick icons/fontdemo.html. If you use them, add the credits in icons/LICENSE.txt to your website's disclaimer page. The example files help/tris-head.html and help/tris-custom.css contain the CSS for the icons. Note that it includes nice icons for Home and External Link, so load it if you want them (see the code in help/tris-custom.css). The standard theme configuration is modified by uploading up to 6 optional files to /wp-content/uploads: - tris-theme-config.php Various options re header, navigation bar, sidebar... + root css vars - tris-head.html Included near start of , right after $GLOBALS['root-css-vars'], and before themes/tris-theme/style.css. Put any "above the fold" stuff here, inline css and js and links to such files which should be requested first. - tris-custom.css Any css you need to add or adjust. Put any media queries with width tests here. - tris-header.html The content of this file will be added at the end of (inside)
(which is position relative) - tris-footerpreflex.php Included as 1st item in #sitefooter - before #footerdiv (latter is a flexbox). Add e.g.

here. - tris-footer.php Replaces the minimal standard content (inside #footerdiv) with whatever you programm (e.g. a widget area) If you select the "Remove Gutenberg" option in tris-theme-config.php then you do not need the "Classic Editor" plugin. Further options allow you to: - add the 'Formats' dropdown to TinyMCE - remove standard WordPress Gallery CSS from the frontend - have auto-emails from WP about plugin and theme updates suppressed (unless errors; default on) - send a comment moderation email only to the author (and NOT to site admin) TRIS Theme supports the 'editor-styles' feature of WordPress for its themes: A file 'editor-style.css' is supplied with the theme and registered to be applied to TinyMCE. To allow use of the CSS :root variables in that file, TRIS Theme writes a copy of their configured values, configured in {tris-}theme-config.php, to a file 'tris-root.css' in the uploads directory. It loads both files to TinyMCE, so that not only the theme's CSS, but also the editor stylesheets of the "TinyMCE Custom Styles" plugin can use them. TODO: TinyMCE Custom Styles: Problems with Gutenberg The theme adds a [menu] shortcode to WordPress, Use: [menu name='menuname']. It also adds shortcode capability to the "Custom HTML" widget, for menus in widget areas. The theme provides two shortcodes to output tags on pages: o [alltags] (sorted by name) o [alltagsbygroup tg='1'] (sorted by slug, for use with "Tag Groups" plugin) The tag name (linked to tag usage page) is output as

, description in a
It also adds tags, categories and excerpts to pages, and can optionally remove Gutenberg. To save using extra plugins, it provides 2 shortcodes for protecting text / emails from harvester via JS ROT13: [tris_encode do_shortcode="no" protection_text=""] ... [/tris_encode] If do_shortcode="yes" is supplied, then other shortcodes within the text to be encoded will be executed. If protection_text is not passed or is empty, then a standard protection text will be used for