• Resolved Chris

    (@lamordnt)


    I just ran theme check on a theme I have and noticed a bunch of errors for how I am linking within my theme. It says that bloginfo(‘url’) is incorrect and basically all of the other reference such as bloginfo(‘template_directory’) is wrong to. Should I be using echo esc_url( home_url() ) instead? I cannot really find any documentation that says bloginfo is wrong. Suggestions? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi Chris!

    Yes, you would want to use esc_url( home_url( '/' ) ) instead. That was deprecated in 2.2 I believe. ( at least looking at the core code ).

    As for 'template_directory' you can simply use get_template_directory_uri() as it does the same thing. bloginfo calls that behind the scenes. 🙂

    Thread Starter Chris

    (@lamordnt)

    Excellent thank you Jose!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘bloginfo('url') vs echo esc_url( home_url() )’ is closed to new replies.