Store unmodified text content in database

You could refer to this: function my_formatter($content) { $new_content=””; $pattern_full=”{(\[raw\].*?\[/raw\])}is”; $pattern_contents=”{\[raw\](.*?)\[/raw\]}is”; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { $new_content .= wptexturize(wpautop($piece)); } } return $new_content; } remove_filter(‘the_content’, ‘wpautop’); remove_filter(‘the_content’, ‘wptexturize’); add_filter(‘the_content’, ‘my_formatter’, 99); Basically, what this does it alters the … Read more

Instructions/Rules Inside Text Area

Add some custom javascript to the admin area, using wp_enqueue_script(). $(document).ready(function() { $(‘#input-id’).attr(‘placeholder’, ‘Did you try Google first?’); }); The placeholder attribute does not work in Internet Explorer yet. You could fall back on a jQuery placeholder plugin if needed.

Post specific text based on category displayed

The easiest way to do it is to use a category template and let WordPress step through its template hierarchy and display the News template when it is called. So you would copy your theme’s category.php to category-news.php (assuming the slug is “news”) and then edit that file to place whatever text you want where … Read more

string translation in functions.php not working

The code you have is correct and will handle the wording even if the case does not match. Your problem is probably that wherever Place Name is being output, it is not being passed through a WordPress translation function, __( ‘Place Name’ ) or _e( ‘Place Name’ ); Either that, or what you’re trying to … Read more

printf and _n in this example?

The _n (see Codex) function accepts four arguments. The first two are texts to be translated (the first is singular, the second plural), the third argument is a number (in this case $count). When $count is 1 the first string is used, otherwise the second string is used. So in fact the first instance of … Read more

Displaying fractions in text

We can paste <sup>3</sup>⁄<sub>16</sub> into the visual editor or write the HTML in the code editor: <!– wp:paragraph –> <p>Testing <sup>3</sup>⁄<sub>16</sub> fraction</p> <!– /wp:paragraph –> or use the subscript and superscript on the text paragraph selections in the visual editor: