return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>plugins - Add style to body based on url
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Add style to body based on url

programmeradmin0浏览0评论

I recently installed a plugin on my wordpress website Look like the developer of this plugin have no creativity. I want to add class to the body based on url so i can customize the template of each page I tried windows.location in javascript , When i call alert() in windows.location , it work fine but when use $(body').addClass , Its not working What should i do ?

I recently installed a plugin on my wordpress website Look like the developer of this plugin have no creativity. I want to add class to the body based on url so i can customize the template of each page I tried windows.location in javascript , When i call alert() in windows.location , it work fine but when use $(body').addClass , Its not working What should i do ?

Share Improve this question asked Dec 12, 2020 at 11:14 ArtanArtan 32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

for your home page: On index.php or your home page custom file use:

if (is_home()){
  echo 'hi home!';
}

for any other page except 404: use the file page.php or the custom one: for example the link is www.xyz.pt/chat/

if (is_page('chat')){
  echo 'hi page!';
}

for page 404:

if (is_404()){
  echo 'hi error 404';
}
发布评论

评论列表(0)

  1. 暂无评论