I gave this talk at WordCamp San Francisco 2013. I was so nervous that I said get_template_fart()
instead of get_template_part()
at around 2:43.
Slides and reference links right here. Let me know what you think!
I gave this talk at WordCamp San Francisco 2013. I was so nervous that I said get_template_fart()
instead of get_template_part()
at around 2:43.
Slides and reference links right here. Let me know what you think!
You know you’re just asking for said function to be implemented as an easter egg right in core, right? ;)
I have no objections.
I’m not going to lie… That’s kinda awesome.
Thanks Chris :)
I hope that you pay you brother ;)
Great talk!
Thanks Teylor :)
Loved the presentation Konstantin, learned a couple of things I was doing kinda wrong.
Cheers.
Thanks Ricard, glad you enjoyed it :)
Ps i am not a theme developer but enjoyed your talk
I use my brother :) lol
Thanks Mark :)
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.
It’s always interesting to get an inside scoop from speakers :) Thanks for your comment!
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 ;)
Thanks Japh :)
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:
But is no longer needed so this is the preferred code:
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
:Versus
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.
Exactly. You would still use function_exists in other places. Thanks for the kind words!
That’s actually quite funny sir, wish I’d been there on the day :D
Heh, thanks for your comment Elliott :)
одна из лучших презентации на конференции спасибо
Спасибо Тимофей :)
Костя, спасибо за презентацию. Хотелось бы конечно, чтобы больше людей форкали underscores, а также не забывали о базовых принципах ООП, типа инкапсуляции и переносили это на компоненты темы – это конечно же позволяет сконцентрироваться на семантическо разметке.
Александр, Рад что вам понравилась :)