【问题标题】:Having an archive page with categories and tags拥有一个包含类别和标签的存档页面
【发布时间】:2015-06-10 13:36:58
【问题描述】:

我想要一个包含分类和标签的存档(替代搜索)在一页上列出。这可能吗?似乎找不到任何相关信息。

标题/档案搜索

按类别浏览:
猫 1、猫 2 等。

(更具体的)按标签浏览:
标签 1、标签 2 等。

【问题讨论】:

    标签: wordpress tags archive categories


    【解决方案1】:

    可能是这样的吗?

    <?php get_header(); ?>
    
    <div id="container">
    <div id="content" role="main">
    
        <?php the_post(); ?>
        <h1><?php the_title(); ?></h1>
    
        <?php get_search_form(); ?>
    
        <h2>Browse by month:</h2>
        <ul>
            <?php wp_get_archives('type=monthly'); ?>
        </ul>
    
        <h2>Browse by category:</h2>
        <ul>
             <?php wp_list_categories(); ?>
        </ul>
    
        <h2>Browse by tags:</h2>
        <ul>
             <?php wp_tag_cloud(','); ?>
        </ul>
    
    </div><!-- #content -->
    </div><!-- #container -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    

    【讨论】:

    • 如何添加这个?我创建了一个新的 php 文件并将其上传到我的主目录,还尝试通过 wordpress 将其添加到页面中。我的主目录无法调用我的标头(与我从其他页面(如 index.php)的调用完全相同)
    猜你喜欢
    • 1970-01-01
    • 2023-03-15
    • 2015-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-24
    • 2016-11-15
    • 1970-01-01
    相关资源
    最近更新 更多