0

我正在这里http://beta.fray.it/invite上的 wordpress 页面上工作,并单击 Twitter 图标我在列表元素上设置了这个 onclick 属性

onclick="window.location.href = '<?php echo get_template_directory_uri(); ?>/components/invite/twitter/redirect.php';">

这将我带到应该将用户重定向到 Twitter 进行身份验证的 php 文件。我在我用于测试的另一台服务器上得到了这个工作,但不是在这里。发生的情况是我从主页http://beta.fray.it看到内容,但没有重定向。这是什么原因?

4

2 回答 2

0

尝试更改您的链接href

 onclick='window.location.href =' + "<?php echo get_template_directory_uri(); ?>" + '/components/invite/twitter/redirect.php';
于 2013-09-12T06:01:01.873 回答
0

在 wp-config.php 中启用 WP_DEBUG 和 WP_DEBUG_LOG 后(WP_DEBUG 默认禁用,因为 WP_DEBUG 设置为 false)。

当出现错误、警告、通知或日志调用时,会在 /wp-content/ 目录中生成 debug.log。

您还可以利用包装器功能来集中您的日志调用

if(!function_exists('_log')){
  function _log( $message ) {
    if( WP_DEBUG === true ){
      if( is_array( $message ) || is_object( $message ) ){
        error_log( print_r( $message, true ) );
      } else {
        error_log( $message );
      }
    }
  }
}

你可以在这里阅读更多相关信息

也可以查看 codex: http ://codex.wordpress.org/Debugging_in_WordPress

于 2013-09-12T08:32:15.247 回答