如何编写is_home函数Wordpress


How to write is_home function Wordpress

不知道如何编写此语句中包含的is_home()

if (function_exists('ditty_news_ticker')){
  ditty_news_ticker(47);
}

我尝试了几种不同的方法,但我一直在打破它。我确信有一个非常简单的解决方案,但我对 php 有点陌生。

if (function_exists('ditty_news_ticker') && is_home()){ ditty_news_ticker(47); }

啊,我想通了:

if (function_exists('ditty_news_ticker') && is_front_page() ){ditty_news_ticker(47);}