Forums » Stripping the title html code from the title tag

RSS feed for this topic

Info

Tags

  1. A number of our titles use italics (Omeka uses em tags). However, the title tag in our header is showing these em tags. I'd like to strip out the <em> and </em> from the title that is returned for the title tag. How would that be done?

    Here's the title tag from our header.php page:

    <title><?php echo settings('site_title'); echo $title ? ' | ' . $title : ''; ?></title>
  2. Omeka has a helper function strip_formatting which you can use to remove HTML tags from a string.

    The current "standard" way to display the title is:

    <title><?php echo settings('site_title'); echo isset($title) ? ' | ' . strip_formatting($title) : ''; ?></title>
  3. Thanks! That worked.

Reply

You must log in to post.