重定向到wordpress的Instagram授权URL
问题描述:
我正在制作一个Divi主题模块,它将在页面上显示用户的Instagram提要。我需要将它们重定向到Instagram授权网址。 divi模块是一个PHP文件。重定向到wordpress的Instagram授权URL
PHP函数header()
不工作: 警告:
不能更改头信息 - 头已经发出(输出 开始在C:\ XAMPP \ htdocs中\测试\ WP-包括\类。 在 ç237):WP-styles.php \ XAMPP \ htdocs中\测试\可湿性粉剂内容\主题\航空维修独生子女\模块\ Instagram的\的init.php 第21行
有什么不同的方式我可以用来将用户重定向到此URL或者我接近这一切都是错误的。
答
您可以使用:
?>
<script type="text/javascript">
window.location.href = 'your_url';
</script>
<?php
或:
echo "<script>window.location.href='your_url'</script>";
而在最后:
$url = "your_url";
echo '<meta HTTP-EQUIV="refresh" content="0;URL=' . $url . '">';
凡0
是的秒数。
工作完美 – Dionysus
太棒了。我很高兴它的工作。 – Ionut