aidai99
V2EX  ›  WordPress

请教大佬 wordpress 如何通过链接判断加载不同的文章模板

  •  
  •   aidai99 · Dec 17, 2018 · 2255 views
    This topic created in 2705 days ago, the information mentioned may be changed or developed.
    我有个 wordpress 网址 www.a.com/p/1.html,里面放上下载地址,通过 www.a.com/p/1.html?down=1 调用,文章点击下载地址或者直接访问,下载页面的内容我想通过新的文章模板 single-down.php (或者其他名字 XX )调用他,请教如何判断实现呢,以前在一个博客看到过找不到了,网上教程都是通过判断栏目 ID 实现的,如何判断 URL 中的?down=xx 来实现呢??
    1 replies    2018-12-23 14:19:09 +08:00
    GG668v26Fd55CP5W
        1
    GG668v26Fd55CP5W  
       Dec 23, 2018 via iPhone
    通过 template_redirect 钩子
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3366 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:41 · PVG 20:41 · LAX 05:41 · JFK 08:41
    ♥ Do have faith in what you're doing.