blog, (edited )
@blog@shkspr.mobi avatar

A completely plaintext WordPress Theme
https://shkspr.mobi/blog/2024/05/a-completely-plaintext-wordpress-theme/

This is a silly idea. But it works. I saw Dan Q wondering about plaintext WordPress themes - so I made one.

This is what this blog looks like using it:

Screenshot showing my blog rendered just as text.

The Code

You only need two files. An index.php and a style.css. The CSS file can be empty, but it needs to exist - otherwise WordPress won't let you activate the theme.

The index file displays the requested post, or front page, in plain text. It isn't the most sophisticated code I've ever written!

header('Content-Type: text/plain; charset=utf-8'); bloginfo( 'name' );echo "nn";if ( have_posts() ) {    while ( have_posts() ) : the_post();        if ( get_post_type() == 'post' ) {            the_time( get_option( 'date_format' ) );             echo "n";        }        the_title();        echo "n";        echo strip_tags( apply_filters( 'the_content', get_the_content() ) );         echo "nnn";    endwhile; }

Obviously, there are no links - so you can't navigate. There are no images - but there's also no alt text. There are no embeds, scripts, styles, or other fancy things. Just plain text.

Enjoy!

https://shkspr.mobi/blog/2024/05/a-completely-plaintext-wordpress-theme/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • wordpress
  • khanakhh
  • magazineikmin
  • osvaldo12
  • GTA5RPClips
  • mdbf
  • Youngstown
  • tacticalgear
  • slotface
  • rosin
  • kavyap
  • ethstaker
  • everett
  • thenastyranch
  • DreamBathrooms
  • megavids
  • InstantRegret
  • cubers
  • normalnudes
  • Leos
  • ngwrru68w68
  • cisconetworking
  • modclub
  • Durango
  • provamag3
  • anitta
  • tester
  • JUstTest
  • lostlight
  • All magazines