我被堆疊。
不能得到它,怎麼把這個變量:
$cat_logo = get_field('game_logo', $tax . '_' . $term_id);
該變種包含的鏈接,這應該是在這段代碼:
<?php echo wpthumb('$cat_logo', 'width=100&height=100&crop=0') ?>
我被堆疊。
不能得到它,怎麼把這個變量:
$cat_logo = get_field('game_logo', $tax . '_' . $term_id);
該變種包含的鏈接,這應該是在這段代碼:
<?php echo wpthumb('$cat_logo', 'width=100&height=100&crop=0') ?>
如果$cat_logo
是一個字符串,它將作爲一個字符串推出。
這將工作:
<?php echo wpthumb($cat_logo, 'width=100&height=100&crop=0') ?>
不要關閉您的變量爲「」或「 ',因爲它會將變量名作爲字符串讀取,讓它將自己寫成字符串。試試這個:
<?php echo wpthumb($cat_logo, 'width=100&height=100&crop=0') ?>
你錯過之間變量名和變量的內容的差異。有沒有點引用變量名都:
<?php echo wpthumb($cat_logo, 'width=100&height=100&crop=0') ?>
如果您需要任何奇怪的原因,你必須用雙引號:
<?php echo wpthumb("{$cat_logo}", 'width=100&height=100&crop=0') ?>
文檔:https://secure.php.net/manual/en/language.types.string.php
http://php.net/manual/en/language.types.string.php#language.types.string.syntax.single – AbraCadaver