HEX
Server: Apache/2.4.59 (Debian)
System: Linux keymana 4.19.0-21-cloud-amd64 #1 SMP Debian 4.19.249-2 (2022-06-30) x86_64
User: lijunjie (1003)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/dk/wp-content/themes/food/custom-post-infos.php
<?php
/**
 * 为某个文章单独选定模板
 */
/* Template Name: custom_post_infos
   Template Post Type: post,page
*/
//echo 'custom_post_infos.php';

get_header('food');

//獲取預設info
//$index_post = 81;
//$home_info = getHomeInfo($index_post);

global $MallMallChannel_index_post_id;
$index_post_id = $MallMallChannel_index_post_id;
$home_info = getHomeInfo($index_post_id);


//$pid = intval($_REQUEST['p']);
//$query = new WP_Query('p=' . $pid);
////print_r($query);
//print_r($query->post);
//$postInfoObj = $query->post;
//$postInfoObj->post_title;


$menu_name = 'infos_menu';
$menuArr = ai_get_menu_items($menu_name);
//print_r($menuArr);
?>
<style>
    #main_bg{
        height: 100%;
    }

    #app{
        height: 100%;
    }
</style>

<app id="app">
    <yq-header></yq-header>
    <!--    <yq-food-menu-infos></yq-food-menu-infos>-->
<!--    style="min-height:60vh;"-->
<!--   style="min-height:80vh;"-->
    <div id="main_bg">
        <main class=" w-100 py-[0.2rem] md:w-[768px] md:mx-auto xl:w-[1280px]" >
            <div class="mx-auto max-w-xl lg:mx-0 lg:flex lg:max-w-none">
                <div class="flex-auto w-auto  lg:w-1/5 ">
                    <div class="float-left p-1 w-10 mr-2 " style="border: 1px solid #cccccc;">
                        <?php //wp_nav_menu(array('menu' => 'infos_menu', 'depth' => 2));
                        ?>

                        <?php
                        if (is_array($menuArr)) {
                            echo '<ul class="menu_main_ul">';

                            foreach ($menuArr as $menu) {
                                echo '<li>' . $menu->title . '</li>';

                                $subMenuArr = $menu->data;
                                if (is_array($subMenuArr)) {
                                    if (count($subMenuArr) > 0) {
                                        echo '<ul class="menu_sub_ul pl-[0.2rem]">';
                                        foreach ($subMenuArr as $sub) {
                                            echo '<li>' . '<a href="' . $sub->url . '">' . $sub->title . '</a></li>';
                                        }
                                        echo '</ul>';
                                    }
                                }
                            }
                            echo '</ul>';
                        }
                        ?>

                    </div>
                </div>

                <div class="float-left w-full md:w-4/5 p-1 mt-1 lg:mt-0 lg:flex-shrink-0 "
                     style="border: 1px solid #cccccc;">
                    <div class="w-auto max-w-md flex-auto overflow-hidden text-[0.26rem] p-1">
                        <?php if (have_posts()) : ?>
                            <?php
                            // Start the loop.
                            while (have_posts()) : the_post();

                                ?>

                                <div class="text-[0.36rem] border-solid border-b-2 border-main-color pb-2"><?php the_title(); ?></div>
                                <p class="mt-2 "><?php the_content(""); ?></p>

                            <?php
                                // End the loop.
                            endwhile;

                        else :
                            //                            get_template_part( 'content', 'none' );
                        endif;
                        ?>

                    </div>

                </div>
            </div>

        </main>
    </div>

    <yq-footer></yq-footer>
</app>


<script>
    const local_url = '<?php echo $local_url ?>'
    const home_info = JSON.parse('<?php echo json_encode($home_info) ?>')
    new Vue({
        el: "#app",
        components: {
            'yq-header': httpVueLoader('<?php showFoodAppPath('components/yq-header.vue?v=5') ?>'),
            'yq-footer': httpVueLoader('<?php showFoodAppPath('components/yq-footer.vue?v=2') ?>'),
        },
        created() {
            // this.get_banner()
        },
        data: {},
        methods: {}
    })
</script>
<?php get_footer('food'); ?>