User Tools

Site Tools


doc:tips:randomentry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
doc:tips:randomentry [2022/11/27 13:52] – added initial content arviddoc:tips:randomentry [2022/11/27 14:21] (current) – old revision restored (2020/04/15 20:50) arvid
Line 1: Line 1:
-====== How to disable character replacement ====== +====== How to link to a random entry ====== 
-===== Default behaviour ===== +You may wish to serve your blog visitors a link to a random entry in your blogTo achieve thisjust append ''?random'' to your site URL.
-By default, FlatPress replaces some characters (or character combinations) within your entries and static pages: +
-  * Two hyphens ("<nowiki>--</nowiki>") become an [[https://www.thepunctuationguide.com/en-dash.html|en dash]] ("–")three ("<nowiki>---</nowiki>") an [[https://www.thepunctuationguide.com/em-dash.html|em dash]] ("—"+
-  * Three dots ("<nowiki>...</nowiki>") become an [[https://www.thepunctuationguide.com/ellipses.html|ellipsis]] ("…"+
-  * Quotations marks become typographic: <nowiki>"text"</nowiki> will become “text” +
-  * Trademark sign: "Text <nowiki>(tm)</nowiki>" is being replaced with "Text ™" +
-  * Multiplication sign: "<nowiki>2x3</nowiki>" is displayed as "2×3" +
-... and a few more.+
  
-===== How to disable ===== +===== Example ===== 
-If you would like FlatPress __not__ to do these character replacements, just tell it to :+Link to a random entry on flatpress.orghttps://www.flatpress.org/?random\\ 
- +(Try and reload! You will be served another random entry each time.)
-After the first two lines of your index.php, just add the ''remove_filter()'' call as shown: +
- +
-<code><?php +
-include 'defaults.php'; +
-include INCLUDES_DIR . 'includes.php'; +
- +
-// ADD THIS LINE: +
-remove_filter('the_content', 'wptexturize'); +
- +
-define('MOD_INDEX', 1); +
- +
-...</code> +
- +
- +
-===== More details ===== +
-The described replacements take place in the function ''wptexturize()'' in //fp-includes/core/core.wp-formatting.php//. Please refer there for a detailled view into the replacement logic.+
doc/tips/randomentry.1669553573.txt.gz · Last modified: 2022/11/27 13:52 by arvid

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki