ab
V2EX  ›  问与答

typecho 能不能判断首页(仅主页,不包含主页 List 分页)

  •  
  •   ab · Oct 12, 2014 · 3159 views
    This topic created in 4367 days ago, the information mentioned may be changed or developed.
    * 如wordpress的一个语句:

    <?php if ( (is_home() || is_front_page()) && !is_paged() ) >

    ...
    ...
    ...
    ?>

    效果是仅在首页输入.
    3 replies  •  2014-10-12 17:55:55 +08:00
    ab
        1
    ab  
    OP
       Oct 12, 2014
    0x142857
        2
    0x142857  
       Oct 12, 2014
    $_SERVER['REQUEST_URI'] ?
    ab
        3
    ab  
    OP
       Oct 12, 2014
    @0x142857 谢谢,已google:

    <?php if($this->is('index') && $this->_currentPage == 1): ?>
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2701 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 07:17 · PVG 15:17 · LAX 00:17 · JFK 03:17
    ♥ Do have faith in what you're doing.