【发布时间】:2013-02-20 12:43:02
【问题描述】:
我正在尝试找到一种解决方案,如何仅在博客主页上显示缩略图图像,并在帖子内显示附加到帖子的所有其他图像。
我用谷歌搜索了它,但没有运气...有人可以帮忙吗?
在这里你可以明白我的意思:blog.turdidesigns.com
我是 wordpress 新手,所以如果这是一个愚蠢的问题,我深表歉意。
谢谢,
【问题讨论】:
标签: image wordpress post thumbnails blogs
我正在尝试找到一种解决方案,如何仅在博客主页上显示缩略图图像,并在帖子内显示附加到帖子的所有其他图像。
我用谷歌搜索了它,但没有运气...有人可以帮忙吗?
在这里你可以明白我的意思:blog.turdidesigns.com
我是 wordpress 新手,所以如果这是一个愚蠢的问题,我深表歉意。
谢谢,
【问题讨论】:
标签: image wordpress post thumbnails blogs
在你的 index.php 文件中替换 the_content(); with the_excerpt();
此外,这可能是一个循环,因此请确保将其替换为文章列表(类别、存档、搜索),而不是单个循环。
【讨论】:
在我的索引 php 中我没有这个...
这是我所拥有的: 在我的主题文件夹 infex php 我只有这个:
<?php get_header(); ?>
<div class="art-layout-wrapper">
<div class="art-content-layout">
<div class="art-content-layout-row">
<div class="art-layout-cell art-content">
<?php get_sidebar('top'); ?>
<?php
if(have_posts()) {
/* Display navigation to next/previous pages when applicable */
if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {
theme_page_navigation();
}
/* Start the Loop */
while (have_posts()) {
the_post();
get_template_part('content', get_post_format());
}
/* Display navigation to next/previous pages when applicable */
if (theme_get_option('theme_bottom_posts_navigation')) {
theme_page_navigation();
}
} else {
theme_404_content();
}
?>
<?php get_sidebar('bottom'); ?>
<div class="cleared"></div>
</div>
<div class="art-layout-cell art-sidebar1">
<?php get_sidebar('default'); ?>
<div class="cleared"></div>
</div>
</div>
</div>
</div>
<div class="cleared"></div>
<?php get_footer(); ?>
我是和 Artisteer 一起做这个主题的,所以不要过多评价我 ;)
【讨论】:
抱歉回复晚了!!!
这里是 content.php 代码:
<?php
/**
*
* content*.php
*
* The post format template. You can change the structure of your posts or add/remove post elements here.
*
* 'id' - post id
* 'class' - post class
* 'thumbnail' - post icon
* 'title' - post title
* 'before' - post header metadata
* 'content' - post content
* 'after' - post footer metadata
*
* To create a new custom post format template you must create a file "content-YourTemplateName.php"
* Then copy the contents of the existing content.php into your file and edit it the way you want.
*
* Change an existing get_template_part() function as follows:
* get_template_part('content', 'YourTemplateName');
*
*/
global $post;
theme_post_wrapper(
array(
'id' => theme_get_post_id(),
'class' => theme_get_post_class(),
'thumbnail' => theme_get_post_thumbnail(),
'title' => '<a href="' . get_permalink( $post->ID ) . '" rel="bookmark" title="' . strip_tags(get_the_title()) . '">' . get_the_title() . '</a>',
'heading' => theme_get_option('theme_'.(is_single()?'single':'posts').'_article_title_tag'),
'before' => theme_get_metadata_icons( 'date,author,edit', 'header' ),
'content' => theme_get_excerpt(),
'after' => theme_get_metadata_icons( 'category,tag,comments', 'footer' )
)
);
?>
【讨论】: