26 thoughts on “Video: get_template_fart() or Things I Wish I Had Known Before Developing a WordPress Theme

  1. I like the function name and I hope, that we can use via core ;)
    Yes, I loved erros and problems, there are human and this is last hope for me, that I not the only speaker with mistakes; my creepy english is enough.

  2. As I’ve said to you in another comment, it was a brilliant talk! The minor mistake didn’t at all detract from the quality of what you were saying.

    It did make me stop for just a second and think “did I hear that right?” though, which was funny ;)

  3. I watched this yesterday and was curious about what you said in relation to if ( is_active_sidebar() ) { add_action…………… and if ( function_exists( ‘home-featured-2’ )

    So there’s no need to add this anymore?

    Keep seeing this on many of the plugin forums for adding plugin functions and in the home.php files of many child themes.

    • Hey Brad, looks like you mixed it up a little bit. I was referring to using function_exists with things like is_active_sidebar, register_sidebar and dynamic_sidebar. Many themes still call function_exists to check whether the function exists before calling it. That’s done for backwards compatibility, but we don’t want our themes to be compatible with 6+ years old WordPress, so we can stop using that :)

    • Ok so this works:

      if ( is_home() && is_active_sidebar('demo-widget') )  {

      But is no longer needed so this is the preferred code:

      if ( is_home()  )  {

      Thanks for the tip Konstantin.

    • Not really. If you want to use is_active_sidebar you can use it. I use it in the Expound theme to hide the sidebar completely if it’s inactive and fall back to a single-column layout.

      What I’m referring to is the call to function_exists:

      if ( function_exists( 'is_active_sidebar' ) && is_active_sidebar( 'sidebar-primary' ) ) ...


      if ( is_active_sidebar( 'sidebar-primary' ) ) ...

      Same for register_sidebar and others. Hope that makes more sense!

    • Thanks for clarifying however you would still use function_exists for plugins not widgets. Just not for adding widgets.

      Example: if ( function_exists( ‘soliloquy_slider’ ) )

      I think what you’re referring to is using the call to function_exists with is_active_sidebar which is no longer needed for backwards compatibility.

      Great video Konstantin and hope to see more on best practice for theme development.

  4. одна из лучших презентации на конференции спасибо

  5. Костя, спасибо за презентацию. Хотелось бы конечно, чтобы больше людей форкали underscores, а также не забывали о базовых принципах ООП, типа инкапсуляции и переносили это на компоненты темы – это конечно же позволяет сконцентрироваться на семантическо разметке.

Comments are closed.