我想刪除文章和頁面上的精選圖像,但將其保留爲縮略圖,以便該網站看起來不錯!我的網站是一個基於WordPress的網站。刪除文章中的精選圖像
下面是該網站的一個例子職位:http://www.tradingspotsilver.com/build-mt4-custom-ea-indicator-forex-free/
你可以看到特色的圖像是在後的頂部,並且佔據了大量的空間。我試圖看看主題來源,但沒有運氣。
我想刪除文章和頁面上的精選圖像,但將其保留爲縮略圖,以便該網站看起來不錯!我的網站是一個基於WordPress的網站。刪除文章中的精選圖像
下面是該網站的一個例子職位:http://www.tradingspotsilver.com/build-mt4-custom-ea-indicator-forex-free/
你可以看到特色的圖像是在後的頂部,並且佔據了大量的空間。我試圖看看主題來源,但沒有運氣。
您可以使用timthumb調整大小:
這裏的代碼:{} https://code.google.com/p/timthumb/source/browse/trunk/timthumb.php
創建一個在你的主題文件夾名爲timthumb.php文件,並在特色圖片PHP腳本的地方,類型:
if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it.
//the_post_thumbnail();
$url = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>
<div class="img-hold"> <img src="<?php bloginfo('template_directory') ?>/timthumb.php?src=<?php echo $url; ?>&w=219&h=125" width="219" height="125" /></div>
<p><? }
echo $content;
?></p>
變化高度和寬度按您的願望在& W =的值,& H =和還寬x高
希望這有助於
在你的問題中給出的鏈接是一個單篇文章頁面,你在看看你的主題的根文件夾,可以找到一個名爲single.php
文件,在該文件中,你可能找到這樣的東西
// "custom_size" could be anything like "single_page_image"
if (has_post_thumbnail()) : the_post_thumbnail('custom_size');
這行代碼負責顯示大圖片。只要刪除這一行,你的圖片就不會出現。此外,您可以檢查this answer以獲取自定義圖像大小。
對於頁面模板,您可以查找名爲page.php
的文件並查找相似的代碼。
只刪除single.php和page.php或content.php中的the_post_thumbnail
代碼。 此功能在wordpress中用於顯示特色,所以只需刪除或評論。
檢查您的single.php和content.php頁面來解決這個問題,它的右邊有
如果你不要求代碼註釋它/或修改它,只要你想。 不誤事去容易或以其他方式,你最終會得到錯誤
我有同樣的問題,我無法找到single.php中
其簡單但任何解決方案:
只是評論:
從content.php頁
這是炫主題 我發現礦「內容single.p惠普並刪除:
<?php the_post_thumbnail('dazzling-featured', array('class' => 'thumbnail')); ?>
圖片已從帖子中消失。
這顯然取決於主題。
爲主題免費增值您需要刪除的wp-content /主題/免費增值以下行/ single.php中:
<?php $freemium_feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); if($freemium_feat_image!="") { ?>
<img src="<?php echo $freemium_feat_image; ?>" alt="Banner" class="img-responsive img-responsive-freemium" />
<?php } ?>
你想要的縮略圖大小的圖片,而不是這個大一個HTTP:/ /www.tradingspotsilver.com/wp-content/uploads/2013/09/strategyquant_ea_wizard_1-580x333.png? –