douchuang1852 2011-02-04 10:39
浏览 12

wordpress中的两个索引类型页面

I have a news section on my site and I have plugged it into the word-press CMS. I would like the index page to show some thumbnails and an excerpt of the post then when you click on a blog title I want it to go to another page with all the posts on but set up in a different format.

I've tried creating a file called newsFeed.php that the index can link to but I can't seem to link to it properly. I tried using <?php (TEMPLATEPATH.'newsFeed.php'); ?> to link to the page but it keeps returning NULL.

Am I going the best way about this? It seemed like such a simple Idea at the time but it's turned into a bit of a mini nightmare lol

  • 写回答

1条回答 默认 最新

  • doumei7420 2011-02-04 16:36
    关注

    in your newsFeed.php include the following code at the top of the page

    <?php
    /*
    Template Name: News
    */
    ?>
    

    Create a new page, call it News. Make a note of the page ID (quickest way to do this, on the list of pages in the page section, hover over the new page and the link will show the page ID in the full URL). Select 'News' as the page template.

    Use

    <?php wp_list_pages('include=7); ?>
    

    where 7 is the page ID of the news page, wherever you want the link to be on your home page.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?