【发布时间】:2015-09-09 14:20:46
【问题描述】:
我是 php 新手,但必须以某种方式解决以下问题:
在我的 ...portfolio_grid.php 中,我成功理解了这部分:
$output .= '
<a class="classic-portfolio-box normal-type-prt'.$colorize_fx_class.'" href="'.get_permalink($post_id).'" title="'.get_the_title().'"'.$colorize_hover.'></a>
<div class="portfolio-box">
<div class="portfolio-naming">
<h2 class="portfolio-title">'.get_the_title().'</h2>';
if( !empty($on_attributes) ){
$output .= '
<h3 class="portfolio-attributes">'.$on_attributes.'</h3>';
}
$output .= '</div>
</div>
<img src="'.$image[0].'" width="'.$image[1].'" height="'.$image[2].'" alt="'.get_the_title().'" />
';
对我的投资组合框中出现的内容负责。现在我想更改以下细节:
$output .= '
<h3 class="portfolio-attributes">'.$on_attributes.'</h3>';
我想输出单个投资组合文本字段的内容,而不是 $on_attributes 变量的内容。我敢打赌这是可能的。
如何获取每个作品集帖子的文本字段的内容并将其发布到那里?我知道 the_content() 或 get_the_content() 函数会以某种方式发挥作用,但它是如何完成的呢?任何帮助表示赞赏!
【问题讨论】:
-
你试过 $output .= '
'。 get_the_content()。 '
'; ?
标签: php wordpress customization