我正在尝试找到一个解决方案,如何只显示博客主页面上的缩略图图像,并在帖子内显示所有其他图像到达帖子。
我用Google搜索没有运气......任何人都可以帮忙吗?
在这里你可以看到我的意思:blog.turdidesigns.com
我是wordpress的新手,所以如果这是一个愚蠢的问题,我会道歉。
谢谢,
答案 0 :(得分:0)
替换the_content();使用the_excerpt();
此外,这可能是一个循环,因此请确保将其替换为文章列表(类别,存档,搜索),而不是单循环。
答案 1 :(得分:0)
在我的索引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一起做了这个主题,所以不要过多地评价我;)
答案 2 :(得分:0)
对不起,迟到了!
这是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' )
)
);
?>