Category Archives: wordpress

Commenting out HTML in a WordPress post or page

Using the built-in Text editor (as opposed to the Visual editor), it’s possible to directly add HTML code to any WordPress post or page. Unfortunately, WordPress doesn’t know how to handle HTML comments correctly. I often find myself wanting to hide HTML code without having to delete it, so these comments are pretty critical. Here’s what a regular HTML […]

Posted in wordpress | Comments closed

Adding identical text to the end of every WordPress post

Ever wonder how to programmatically add identical text to the end of every one of your WordPress posts? For example, a Google Adsense script or some social-sharing buttons? Try adding this to your functions.php file: 1 2 3 4 5 6 7 add_filter(’the_content’, ‘add_some_text’);   function add_some_text($content){ global $post; $content = $content . ‘TEXT TO ADD […]

Posted in wordpress | Tagged , | Comments closed
  • Categories

  • Archives