Support » Fixing WordPress » Using % in title throws error

  • I have an odd issue. Whenever the character % is used in a title, I get a Warning: sprintf() [function.sprintf]: Too few arguments in /home/… error showing up in my post and archive listing.

    How can this be corrected?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you tried temporarily switching to one of the default themes (e.g. TwentyEleven) and seeing if the % character still causes the error message to appear? If it doesn’t then there’s something in your theme that is causing the issue.

    I’ll look into this, it’s most likely a theme issue. Just not sure if anyone else ever received a similiar issue that might have a suggestion for a fix.

    Thanks.

    % means something special to the sprintf function. Generally speaking, your theme should probably use echo instead of sprintf– but you shouldn’t modify the theme directly. You ought to make a child theme and “override” the header.php file, using echo to output the title instead.

    And you should also let the theme author know about the issue, so they can correct it in their next update.

    Okay, will do. Thanks Andrew.

    Just following up — is this still an issue, or were you able to resolve it?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using % in title throws error’ is closed to new replies.