Support » Theme: Travelify » Warning: sprintf(): Too few arguments

  • Hi,
    I ran into this error which seems to be wide spread with Travelify (just do a Google search):

    Warning: sprintf(): Too few arguments in public_html/wp-content/themes/travelify/library/functions/functions.php on line 436

    While looking into the code I found that the syntax seems to have an error in lin 436. The command sprintf() according to my knowledge requires as the first parameter a formating string which is currently missing.

    So instead of
    $byline = sprintf('<span class="author vcard"> which causes the php warning I use this code: $byline = sprintf("%s",'<span class="author vcard"> in line 436.

    Maybe that helps also other people solve the issue and can be added in the next update.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @belgarath,

    I hope you are well today and thank you for your question.

    I have tested it on my test site using latest version of Travelify theme but didn’t get any warning message even setting WP debug to true.

    Which version of theme are you using?

    This can be due to plugin conflict on your site so please try temporary deactivating all plugins and see whether everything works fine and then enable the plugins one by one to see which plugin is conflicting if any.

    See in the following topic it was due to plugin conflict.

    https://colorlib.com/wp/forums/topic/script-error/

    Best regards,
    Vinod Dalvi

    Hi Vinod,

    thanks for your response. I run the latest theme version 3.0.4 and had already disabled all plugins but still got the warning message. With the solution above the warning disappears.

    If you look at the sprint() syntax here: http://www.w3schools.com/php/func_string_sprintf.asp you see that the ‘format’ parameter is mentioned as ‘required’.

    Anyway, my problem is solved – I just thought it would be a good idea to add the fix with the next theme update as several websites using the Travelify theme can be found on Google displaying that error message.

    Thank you for notifying us about the issue.

    The issue doesn’t occur on my test site so may be it occurs only with specific condition therefore i have notified this to the theme developer so that it will be resolved in the future version of theme.

    Thanks

    Some same issues for http://www.alphabetwebz.com/ web developer – functions.php..

    Some client domain:

    http://carrentalchennai.in/
    Warning: sprintf(): Too few arguments in /home/car2entalchen/public_html/wp-admin/includes/class-bulk-upgrader-skin.php on line 154

    I have reported the issue on the following page and hope it will be resolved ASAP.

    https://github.com/puikinsh/Travelify/issues/28

    @friendswebservices Which version of PHP are you using?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Warning: sprintf(): Too few arguments’ is closed to new replies.