<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                【10.WordPress Featured Image Tutorial】 【1.一個簡單的添加特色圖案例】: 1.在后臺創建特色圖增加功能,在functioni.php加入如下代碼 ~~~ // Theme setup function learningWordPress_setup(){ // Navigation Menus 注冊菜單功能 register_nav_menus(array( 'primary' => __( 'Primary Menu' ), 'footer' => __( 'Footer Menu' ), )); // And featured image support add_theme_support('post-thumbnails'); } add_action('after_setup_theme', 'learningWordPress_setup'); ~~~ 2.在index.php添加縮略圖無加工代碼: `<?php the_post_thumbnail(); ?>` 效果如下: ![](https://box.kancloud.cn/63b9f48c819615b8cbb9f0f1188d9170_850x829.jpg) 【2.完整一些的添加案例】: 1.在function.php添加代碼: ~~~ // Theme setup function learningWordPress_setup(){ // Navigation Menus 注冊菜單功能 register_nav_menus(array( 'primary' => __( 'Primary Menu' ), 'footer' => __( 'Footer Menu' ), )); // And featured image support add_theme_support('post-thumbnails'); add_image_size('small-thumbnail',180,120,true); add_image_size('banner-image',920,210,array('left','top')); } add_action('after_setup_theme', 'learningWordPress_setup'); ~~~ 如圖: ![](https://box.kancloud.cn/b7aae8bb2a3803a2b330835ededbe3d7_704x324.png) 2.在index.php添加代碼: ~~~ <article class="post <?php if (has_post_thumbnail() ) { ?> has-thumbnail <?php } ?>"> <!-- post-thumbnail --> <div class="post-thumbnail"> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('small-thumbnail'); ?></a> </div><!-- /post-thumbnail --> <!-- ... </article> --> ~~~ 如圖: ![](https://box.kancloud.cn/4587ca9a9721efd1ad1974b41c618a4a_1316x920.png) 3.在single.php添加代碼: <?php the_post_thumbnail('banner-image'); ?> 如圖: ![](https://box.kancloud.cn/347598397513624eed3c6d3bc8c5fb48_1315x709.png) 4.在style.css添加樣式代碼: ~~~ /* Image Style */ img{ max-width:100%; height:auto; } .has-thumbnail{ position:relative; padding-left:200px; } .post-thumbnail{ position:absolute; top:0; left:0; } ~~~ 如圖: ![](https://box.kancloud.cn/860f62f15b8914c19eb4e71e127e27ab_687x301.png) 輸入以上代碼,實際效果是這樣: ![](https://box.kancloud.cn/cecaae661974c707894620f14850f6a0_775x735.png) 而理論上的效果,應該是這樣: ![](https://box.kancloud.cn/f9f427cdddee10c3b9c65070fcc68073_770x733.png) 當然,這只是一個簡單的案例展示,真正的需要我們自己不斷去完善。 【備注】: 上傳圖片的時候,wordpress除了本身尺寸外,還會自動生成幾種不同的尺寸,150X150,300X180,768X480,1024X640: ![](https://box.kancloud.cn/50139e620f6ee8001329ba1b37624451_559x171.jpg) 當對媒體庫的圖片進行截裁時,生效時,源文件會另外生成一個新的圖片尺寸: ![](https://box.kancloud.cn/36e3d05f9ab6f6623e5f0cfd7e942da3_798x284.png) 但是在后臺中看到的會是直接替換原來的圖片: ![](https://box.kancloud.cn/f415eec3178694031beac7882f4a5d36_826x555.jpg) 在wordpress中,有時想要修改圖片的顯示設置生效,需要重新上傳一次圖片,如在single.php想要顯示不同尺寸的圖片。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看