EEfaq论坛-赚客自留地

 找回密码
 免费注册
查看: 1750|回复: 10

问个问题,关于12-12这个主题

  [复制链接]
发表于 2013-10-15 00:04:30 | 显示全部楼层 |阅读模式
本帖最后由 非常小黑 于 2013-10-15 00:05 编辑

默认的列表页,显示的文章,都是全部文章(或者摘要)
怎么修改才能只显示post标题列表?
category.php这个文件代码如下:
  1. get_header(); ?>

  2.         <section id="primary" class="site-content">
  3.                 <div id="content" role="main">

  4.                 <?php if ( have_posts() ) : ?>
  5.                         <header class="archive-header">
  6.                                 <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' ); ?></h1>

  7.                         <?php if ( category_description() ) : // Show an optional category description ?>
  8.                                 <div class="archive-meta"><?php echo category_description(); ?></div>
  9.                         <?php endif; ?>
  10.                         </header><!-- .archive-header -->

  11.                         <?php
  12.                         /* Start the Loop */
  13.                         while ( have_posts() ) : the_post();

  14.                                 /* Include the post format-specific template for the content. If you want to
  15.                                  * this in a child theme then include a file called called content-___.php
  16.                                  * (where ___ is the post format) and that will be used instead.
  17.                                  */
  18.                                 get_template_part( 'content', get_post_format() );
  19.                                 

  20.                         endwhile;

  21.                         twentytwelve_content_nav( 'nav-below' );
  22.                         ?>

  23.                 <?php else : ?>
  24.                         <?php get_template_part( 'content', 'none' ); ?>
  25.                 <?php endif; ?>

  26.                 </div><!-- #content -->
  27.         </section><!-- #primary -->

  28. <?php get_sidebar(); ?>
  29. <?php get_footer(); ?>
复制代码
get_template_part( 'content', get_post_format() )
应该是post的格式吧?
然后我在content.php里面,找啊找,没找到对应的 if is_category() 这个判断。
那么我傻了。。。
各位神出来帮忙啊。


发表于 2013-10-15 08:09:02 | 显示全部楼层



楼主说的应该不是 12-12,应该是2012 (= twentytwelve)

wordpress.org上已经有答案了,可以直接参考。 而且就是你需要的2012的。按orion310591的做法做吧

http://wordpress.org/support/top ... s-in-category-pages





评分

参与人数 1e币 +3 收起 理由
非常小黑 + 3 高手啊

查看全部评分

回复 支持 反对

使用道具 举报

发表于 2013-10-15 08:26:05 | 显示全部楼层
一个不要PHP循环,一个无效掉?
回复 支持 反对

使用道具 举报

发表于 2013-10-15 09:55:14 | 显示全部楼层
PHP学了很久,无所成啊
回复 支持 反对

使用道具 举报

发表于 2013-10-15 20:19:49 | 显示全部楼层
小黑的问题解决了吗,建议不要去搞代码哦
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-15 21:13:23 | 显示全部楼层

应该可以解决。
主要是试试silo架构,看看是不是可以一个站搞5-10个landing page和keywords
代码不改,主要就是看看模板是怎么个结构,以后熟悉了自己就可以调试。

回复 支持 反对

使用道具 举报

发表于 2013-10-15 21:22:17 | 显示全部楼层
非常小黑 发表于 2013-10-15 21:13
应该可以解决。
主要是试试silo架构,看看是不是可以一个站搞5-10个landing page和keywords
代码不改,主 ...

有点不明白  广告商或联盟不允许一个域名下搞多个lp么    求解?


回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-15 22:23:08 | 显示全部楼层
phozan 发表于 2013-10-15 21:22
有点不明白  广告商或联盟不允许一个域名下搞多个lp么    求解?

这个怎么会不允许呢?
                          
回复 支持 反对

使用道具 举报

发表于 2013-10-15 22:50:10 | 显示全部楼层
非常小黑 发表于 2013-10-15 22:23
这个怎么会不允许呢?

那你完全可以在一个站下简历任意多个lp   是不是基于其他方面的考虑啊

回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-10-16 00:39:35 | 显示全部楼层
phozan 发表于 2013-10-15 22:50
那你完全可以在一个站下简历任意多个lp   是不是基于其他方面的考虑啊

...

做一个标准架构,以后都按这个架构来。
回头我写一个标准架构供大家参考。

回复 支持 反对

使用道具 举报

发表于 2013-10-16 03:20:15 来自手机 | 显示全部楼层
content.php 找the_content(),前面加if(!is_category())

评分

参与人数 1e币 +3 收起 理由
非常小黑 + 3 哇,这个办法也可以

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

QQ|联系我们|Archiver|手机版|小黑屋|EEfaq论坛

GMT+8, 2024-5-2 17:45

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表