我尝试为最近的推文小部件实现Codebird。每次我将其添加到我的 functions.php 时,我都会看到一个白屏(我认为500内部服务器错误)。我不知道Codebird真的很好,所以我希望有人能帮助我。
$options = get_option('wordpress_theme_options');
add_action( 'init', 'my_twitter_api' );
function my_twitter_api() {
global $cb;
$consumer_key = $options['consumer_key'];
$consumer_secret = $options['consumer_secret'];
$access_token = $options['access_token'];
$access_secret = $options['access_secret'];
include("codebird.php");
Codebird::setConsumerKey( $consumer_key, $consumer_secret );
$cb = Codebird::getInstance();
$cb->setToken( $access_token, $access_secret );
}