WordPress.org

Ready to get started?Download WordPress

Forums

Using % in title throws error (6 posts)

  1. kaotik
    Member
    Posted 1 year ago #

    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?

  2. andrewmills
    Member
    Posted 1 year ago #

    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.

  3. kaotik
    Member
    Posted 1 year ago #

    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.

  4. andrewmills
    Member
    Posted 1 year ago #

    % 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.

  5. kaotik
    Member
    Posted 1 year ago #

    Okay, will do. Thanks Andrew.

  6. andrewmills
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.