从客户区wordpress检索数据
我想把wordpress上某篇文章的标题改成粗体,我有以下代码:从客户区wordpress检索数据,wordpress,Wordpress,我想把wordpress上某篇文章的标题改成粗体,我有以下代码: <?php $title_popup = sprintf(__('Uploaded on %s', 'cuar'), get_the_date()); $file_count = cuar_get_the_attached_file_count($post->ID); if(strpos(get_the_title(get_the_ID()),'Garajes Gran')!==false){
<?php
$title_popup = sprintf(__('Uploaded on %s', 'cuar'), get_the_date());
$file_count = cuar_get_the_attached_file_count($post->ID);
if(strpos(get_the_title(get_the_ID()),'Garajes Gran')!==false){
?>
<tr>
<td class="cuar-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr($title_popup); ?>"><strong><?php the_title(); ?></strong></a>
</td>
<td class="text-right cuar-file-count">
<span class="label label-rounded label-default"><?php echo sprintf(_n('%1$s file', '%1$s files', $file_count, 'cuar'), $file_count); ?> </span>
</td>
</tr>
<?php
}
非常感谢。不要使用_title();使用get_the_title()
而不是使用_title();使用get_the_title()
它不起作用,因为当我这样做时,标题消失了。谢谢你回音了吗?就像这样,我忘记了回音,但它不起作用,因为一切都以粗体显示。它不起作用,因为当我这样做时,标题消失了。谢谢你回音了吗?像这样我忘了回音,但它不起作用,因为所有的东西都显示为粗体
Presupuestos (Garajes Gran Via) 0 files
Presupuestos (Viviendas) 0 files
Contratos (Garajes Gran Via) 5 files
Contratos (Viviendas Gran Vía) 6 files
Contadores de Agua 0 files
Estatutos (Viviendas) 1 file
Estatutos (Garajes Gran Vía)
<td class="cuar-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr($title_popup); ?>"><strong><?php echo get_the_title(); ?></strong></a>
</td>