Bones Wordpress主题 - 精选图片

时间:2014-12-29 02:59:45

标签: php wordpress

我在使用骨骼主题here中的功能图像时遇到了一些麻烦。

我做了以下事情:

切换主题以确保其与主题相关的问题。 (切换主题时,功能图像有效)

检查functions.php是否包含以下内容:

// Thumbnail sizes
add_image_size( 'bones-thumb-600', 600, 150, true );
add_image_size( 'bones-thumb-300', 300, 100, true );

检查bones.php是否包含以下内容:

// wp thumbnails (sizes handled in functions.php)
add_theme_support( 'post-thumbnails' );

// default thumb size
set_post_thumbnail_size(125, 125, true);

我还安装了一个Regenerate Thumbnails插件,因为它可以在过去的主题中使用。这些都没有用,有什么想法吗?先感谢您。

的index.php

    <?php get_header(); ?>

    <div id="inner-content" class="wrap cf">
    <div id="viewport">
    <div class="wrapper">
    <img id="slide" src="http://anythingforachickenwing.com/wp-content/uploads/2014/12/title.png" />
    </div>
    <div class="smoke" style="opacity: 0; left: 265.239558015019px; bottom: 585.729198143397px;"></div><div class="smoke" style="opacity: 0; left: 111.303957477212px; bottom: 521.699095993304px;"></div><div class="smoke" style="opacity: 0; left: 239.788159001619px; bottom: 553.840273584435px;"></div><div class="smoke" style="opacity: 0; left: 88.1203758250922px; bottom: 460.576940496822px;"></div><div class="smoke" style="opacity: 0; left: 256.351662445813px; bottom: 459.45647378021px;"></div><div class="smoke" style="opacity: 0; left: 213.352671097964px; bottom: 473.240349265965px;"></div><div class="smoke" style="opacity: 0.0428989610039475; left: 124.163146708161px; bottom:     406.1637748553px;"></div><div class="smoke" style="opacity: 0; left: 123.810111656785px; bottom: 432.110615685945px;"></div><div class="smoke" style="opacity: 0.521737447880111; left: 265.582363512367px; bottom: 334.704566204715px;"></div><div class="smoke" style="opacity: 0.999999959327771; left: 189.805412730202px; bottom: 262.790356662239px;"></div><div class="smoke" style="opacity: 0.889399847109862; left: 272.278033960611px; bottom: 250.057484541929px;"></div><div class="smoke" style="opacity: 0.897183034785094; left: 84.0002758614719px; bottom: 250.93308124543px;"></div><div class="smoke" style="opacity: 0.386225119123995; left: 154.982028547674px; bottom: 193.450337617564px;"></div><div class="smoke" style="opacity: 0.134262293133453; left: 189.276512218639px; bottom: 165.104502551952px;"></div><div class="smoke" style="opacity: 0.0615213497479412; left: 233.832862060517px; bottom: 156.921147440053px;"></div></div>

<script type="text/javascript">$(function(){
    if(!$.browser.msie){
        var a=0;for(;a<15;a+=1){setTimeout(function b(){var a=Math.random()*1e3+5e3,c=$("<div />",{"class":"smoke",css:{opacity:0,left:Math.random()*200+80}});$(c).appendTo("#viewport");$.when($(c).animate({opacity:1},{duration:a/4,easing:"linear",queue:false,complete:function(){$(c).animate({opacity:0},{duration:a/3,easing:"linear",queue:false})}}),$(c).animate({bottom:$("#viewport").height()},{duration:a,easing:"linear",queue:false})).then(function(){$(c).remove();b()})},Math.random()*3e3)}
    }else{      
    "use strict";var a=0;for(;a<15;a+=1){setTimeout(function b(){var a=Math.random()*1e3+5e3,c=$("<div />",{"class":"smoke",css:{left:Math.random()*200+80}});$(c).appendTo("#viewport");$.when($(c).animate({},{duration:a/4,easing:"linear",queue:false,complete:function(){$(c).animate({},{duration:a/3,easing:"linear",queue:false})}}),$(c).animate({bottom:$("#viewport").height()},{duration:a,easing:"linear",queue:false})).then(function(){$(c).remove();b()})},Math.random()*3e3)}}}())</script>

</div>



<div id="inner-content" class="wrap cf">

<div id="intro">
<h1>welcome to anything for a chicken wing. featuring wings from the space coast (and surrounding areas). 
if you've got a wing joint you think should be on here please, <a href="http://anythingforachickenwing.com/contact">drop me a line.</a>


</h1>


</div>

</div>
            <div id="content">

                <div id="inner-content" class="wrap cf">

                        <main id="main" class="m-all t-2of3 d-5of7 cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">

                            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                            <article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article">

                                <header class="article-header">

                                    <h1 class="h2 entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
                                    <p class="byline entry-meta vcard">
                                                        <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
                                                    /* the time the post was published */
                                                    '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
                                                    /* the author of the post */
                                                    '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
                                                ); ?>
                                    </p>

                                </header>

                                <section class="entry-content cf">
                                    <?php the_content(); ?>
                                </section>

                                <footer class="article-footer cf">
                                    <p class="footer-comment-count">
                                        <?php comments_number( __( '<span>No</span> Comments', 'bonestheme' ), __( '<span>One</span> Comment', 'bonestheme' ), __( '<span>%</span> Comments', 'bonestheme' ) );?>
                                    </p>


                    <?php printf( '<p class="footer-category">' . __('filed under', 'bonestheme' ) . ': %1$s</p>' , get_the_category_list(', ') ); ?>

                  <?php the_tags( '<p class="footer-tags tags"><span class="tags-title">' . __( 'Tags:', 'bonestheme' ) . '</span> ', ', ', '</p>' ); ?>


                                </footer>

                            </article>

                            <?php endwhile; ?>

                                    <?php bones_page_navi(); ?>

                            <?php else : ?>

                                    <article id="post-not-found" class="hentry cf">
                                            <header class="article-header">
                                                <h1><?php _e( 'Oops, Post Not Found!', 'bonestheme' ); ?></h1>
                                        </header>
                                            <section class="entry-content">
                                                <p><?php _e( 'Uh Oh. Something is missing. Try double checking things.', 'bonestheme' ); ?></p>
                                        </section>
                                        <footer class="article-footer">
                                                <p><?php _e( 'This is the error message in the index.php template.', 'bonestheme' ); ?></p>
                                        </footer>
                                    </article>

                            <?php endif; ?>


                        </main>
<?php get_sidebar(); ?>


                </div>

            </div>


<?php get_footer(); ?>

1 个答案:

答案 0 :(得分:1)

您的主题没有缩略图获取代码。请更新 While循环,如下所示:

                        <article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article">

                            <header class="article-header">

                                <h1 class="h2 entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
                                <p class="byline entry-meta vcard">
                                                    <?php printf( __( 'Posted %1$s by %2$s', 'bonestheme' ),
                                                /* the time the post was published */
                                                '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>',
                                                /* the author of the post */
                                                '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link( get_the_author_meta( 'ID' ) ) . '</span>'
                                            ); ?>
                                </p>

                            </header>

                            <section class="entry-content cf">
                                <?php     the_post_thumbnail( array(125, 125) ); the_content(); ?>
                            </section>

                            <footer class="article-footer cf">
                                <p class="footer-comment-count">
                                    <?php comments_number( __( '<span>No</span> Comments', 'bonestheme' ), __( '<span>One</span> Comment', 'bonestheme' ), __( '<span>%</span> Comments', 'bonestheme' ) );?>
                                </p>


                <?php printf( '<p class="footer-category">' . __('filed under', 'bonestheme' ) . ': %1$s</p>' , get_the_category_list(', ') ); ?>

              <?php the_tags( '<p class="footer-tags tags"><span class="tags-title">' . __( 'Tags:', 'bonestheme' ) . '</span> ', ', ', '</p>' ); ?>


                            </footer>

                        </article>