如何在wordpress中从数据库创建动态菜单?

时间:2014-08-01 11:50:32

标签: php mysql wordpress

<?php
if(qtrans_getLanguage()=='fr') 
{
    ?>
    <div id="menu">

    <?php wp_nav_menu(array(
        'theme_location' => 'header_navigation', // menu slug from step 1
        'container'       => 'false', // 'div' container will not be added
    //'menu_class' => 'nav', // <ul class="nav"> 
    //'fallback_cb' => 'default_header_nav', // name of default function from step 2
    )); ?>

    </div>

    <?php } ?>

    <?php
        if(qtrans_getLanguage()=='en') {
    ?>
    <div id="menu">

    <?php wp_nav_menu(array(
        'theme_location' => 'engheader_navigation', // menu slug from step 1
        'container'       => 'false', // 'div' container will not be added
        //'menu_class' => 'nav', // <ul class="nav"> 
        //'fallback_cb' => 'default_header_nav', // name of default function from step 2
    )); ?>

    </div>

<?php } ?>

上面是header.php文件代码 如何在WordPress中从外部MySQL数据库创建动态菜单? 任何人都可以建议PHP代码吗?

0 个答案:

没有答案