這是我用它來創建一個子菜單,列出所有自定義後我在WordPress創建代碼:加入主動/當前類到子菜單的自定義文章標題
<ul class="submenu">
<img src="<?php bloginfo('template_directory'); ?>/images/submenu.png" alt="submenu" width="62" height="1" />
<!-- List post types -->
<?php
$the_query = new WP_Query('post_type=artworks_post');
// The Loop
while ($the_query->have_posts()) : $the_query->the_post();
echo '<li id="submenu_link" class="submenu_item_link">';
echo '<a href="' .get_permalink(). '" > ';
the_title();
echo '</a>';
echo '</li>';
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
<img src="<?php bloginfo('template_directory'); ?>/images/submenu.png" alt="submenu" width="62" height="1" />
</ul>
比如我目前的職位是artworks_post /項目 - 但它不會在子菜單中添加當前/活動類的標題(Project Coke標題)。
如何添加活動/當前類到子菜單中當前帖子的標題?
子菜單構成,即辦法讓自定義後...
謝謝,我沒有你貼什麼,但看網頁,結果是不同的: (http://webkunst.comeze.com/test/artworks_post/project-coke/ – codek
更新,你可以試試安吉安? @diego – l2aelba
是的,它的工作原理!非常感謝你! – codek