简体   繁体   English

如何考虑wordpress的类别

[英]How to take in consideration the category of wordpress

In this script I want to put an additional condition according to the category ID or category name;在这个脚本中,我想根据类别 ID 或类别名称添加一个附加条件; How can I do it ?我该怎么做 ? in the syntax "else" The catégory name is pinel ans the id is number 3 Thanks for your help Maxwell在语法“else”中,类别名称是 pinel 并且 id 是数字 3 感谢您的帮助 Maxwell

$ip = $_SERVER['REMOTE_ADDR'];
$bots = array(
    'google' => array('209.85.128','66.102.0','72.14.208','216.239.48','74.125.0','72.14.192','64.233.176','64.233.160','74.125.64','216.239.32','74.125.128','72.14.240','209.85.160','70.32.128','66.249.64','209.85.192','199.223.232','192.178.0','192.158.28','173.255.112','173.194.0','172.253.0','172.217.0','142.250.0','108.59.80','108.177.0'),
    'yahoo' => array('209.131.62','209.131.32','8.12.144','98.139.204','98.139.144','98.139.0','98.137.63','98.137.62','98.137.128','98.137.0','98.136.50','98.136.0','98.136.0','76.13.6','76.13.222','76.13.220','76.13.218','76.13.216','76.13.210','76.13.128','76.13.0','69.147.96','69.147.87','69.147.83','69.147.80','69.147.76','69.147.64','69.147.64','68.180.211','68.180.208','68.180.206','68.180.195','68.180.184','68.180.144','67.195.42','67.195.0','67.195.0','50.85.0','208.71.40','208.67.67','208.67.64','184.165.0'),
    'bing' => array('65.52.104','65.52.108','65.55.24','65.55.52','65.55.55','65.55.213','65.55.217','131.253.24','131.253.46','40.77.167','199.30.27','157.55.16','157.55.18','157.55.32','157.55.36','157.55.48','157.55.109','157.55.110','157.55.110','157.56.92','157.56.93','157.56.94','157.56.229','199.30.16','207.46.12','207.46.192','207.46.195','207.46.199','207.46.204','157.55.39')    
);

if($ip==$bots){
  true;
}else{
  header('Location: https://www.google.fr');
}

I would like that if it is a bot, the bot continues on the page, if it is a visitor , and that visitor clicked on a post in the category "pinel" or ID3 then it is redirected to http://www.google.fr if the visitor clicked on a post in the category "scpi" or ID4 it will be redirected to http://www.yahoo.fr我想,如果它是一个机器人,机器人继续在页面上,如果它是一个访问者,并且该访问者点击了类别“pinel”或 ID3 中的帖子,然后它被重定向到http://www.google .fr如果访问者点击了“scpi”或 ID4 类别中的帖子,它将被重定向到http://www.yahoo.fr

Excuse me but my English is very poor对不起,我的英语很差

Thanks for your help Max感谢您的帮助马克斯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM