I tried looking at the wiki.wordpress articles and I got no where. I am so confused. I followed the steps and everything, but when I tried to publish a test post, I got an error. I'll include the my-hacks.php file here. Can someone help? Thank you. Here is the error:
Warning: Cannot modify header information - headers already sent by (output started at /home/spirit89/public_html/my-hacks.php:3) in /home/spirit89/public_html/wp-admin/post.php on line 158
<?php
function sortr_longer($first, $second) {
return (strlen($first) < strlen($second)) ? 1 : -1;
}
?>
<?php
function acronymit($text) {
$acronyms = array(
'WYSIWYG' => 'what you see is what you get',
'XHTML' => 'eXtensible HyperText Markup Language',
'IIRC' => 'if I remember correctly',
'HDTV' => 'High Definition TeleVision',
'LGPL' => 'GNU Lesser General Public License',
'MSDN' => 'Microsoft Developer Network',
'WCAG' => 'Web Content Accessibility Guidelines',
'SOAP' => 'Simple Object Access Protocol',
'OPML' => 'Outline Processor Markup Language',
'MSIE' => 'Microsoft Internet Explorer',
'FOAF' => 'Friend of a Friend vocabulary',
'GFDL' => 'GNU Free Documentation License',
'XSLT' => 'eXtensible Stylesheet Language Transformation',
'HTML' => 'HyperText Markup Language',
'IHOP' => 'International House of Pancakes',
'IMAP' => 'Internet Message Access Protocol',
'RAID' => 'Redundant Array of Independent Disks',
'HPUG' => 'Houston Palm Users Group',
'VNC' => 'Virtual Network Computing',
'URL' => 'Uniform Resource Locator',
'W3C' => 'World Wide Web Consortium',
'MSN' => 'Microsoft Network',
'USB' => 'Universal Serial Bus',
'P2P' => 'Peer To Peer',
'PBS' => 'Public Broadcasting System',
'RSS' => 'Rich Site Summary',
'SIG' => 'Special Interest Group',
'RDF' => 'Resource Description Framework',
'AOL' => 'American Online',
'PHP' => 'PHP Hypertext Processor',
'SSN' => 'Social Security Number',
'JSP' => 'Java Server Pages',
'DOM' => 'Document Object Model',
'DTD' => 'Document Type Definition',
'DVD' => 'Digital Video Disc',
'DNS' => 'Domain Name System',
'CSS' => 'Cascading Style Sheets',
'CGI' => 'Common Gateway Interface',
'CMS' => 'Content Management System',
'FAQ' => 'Frequently Asked Questions',
'FSF' => 'Free Software Foundation',
'API' => 'Application Interface',
'PDF' => 'Portable Document Format',
'IIS' => 'Internet Infomation Server',
'XML' => 'eXtensible Markup Language',
'XSL' => 'eXtensible Stylesheet Language',
'GPL' => 'GNU General Public License',
'KDE' => 'K Desktop Environment',
'IE' => 'Internet Explorer',
'CD' => 'Compact Disk',
'GB' => 'Gigabyte',
'MB' => 'Megabyte',
'KB' => 'Kilobyte'
);
uksort($acronyms, 'sortr_longer'); // comment out if already sorted
foreach ($acronyms as $acronym => $definition) {
$text = preg_replace("#$acronym(?!</(ac|sp))#", "$acronym", $text, 1);
$text = preg_replace("#$acronym(?!</(ac|sp))#", "<span class='caps'>$acronym</span>", $text);
}
return $text;
}
add_filter('the_content', 'acronymit');
?>
I hope someone can help. Thank you again.