Viewing 5 replies - 1 through 5 (of 5 total)
  • Looks like the esc_attr function is being applied to the title. Did you get a theme update, or maybe put in some special code?

    Thread Starter Trent

    (@trentrey)

    vtxyzzy:

    I didn’t add any special code (don’t know how to do that–my skills are pretty basic). I did do a theme update fairly recently, but I think it was before this problem started. I notice that a post I published on December 14 does not have the issue, so this is pretty new.

    What is the esc_attr function?

    esc_attr is a function that is used to encode or ‘escape’ html attributes before storing them in the database, since unescaped attributes can cause problems in the database. It changes a less-than sign ‘<‘ to ‘& lt;’, for example.

    If you open the two pages you gave in IE, and go to Page->View Source, you can see the difference. Search for the titles; one will have < em >, the other will have & lt;em& gt; (without the spaces).

    When you go to the Admin page, Posts->Edit, what do you see in the titles? Do they have the normal < em > tags, or something else?

    Thread Starter Trent

    (@trentrey)

    vtxyzzy:

    I see what you mean in the page source. This is odd, because in the editor the header has the <e m> tags.

    Quite accidentally, I figured out how to fix this. I do not know if this issue is specific to my theme (Atahualpa) or not, but here’s what I did anyway.

    On the Edit Page screen, there are two options. They are:

      Body Title Single Pages
      Body Title Multi Post Pages

    These options auto-populate with whatever the header is. So in my example:

    Body Title Single Pages: <e m>Plunder Squad</e m> (1972)

    If I delete the text from both of these fields, and then save the page, they will again auto-populate and look exactly like they did before, but for some reason the <e m> in the header will now work. Quite the headscratcher.

    (I’ll leave the messed-up page up for a few days just to give anyone curious a chance to see what we were talking about.)

    Glad you found it. Please mark the topic ‘Resolved’ so others will see you found a solution.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘<em> tag not working in page and post titles’ is closed to new replies.