Wordpress doesnt proces external php file

后端 未结 1 1433
余生分开走
余生分开走 2021-01-25 08:22

I am making an attempt to write my own theme for wordpress and have written a file that contains all my modals (twitter bootstrap), which are html. I added that to the theme sec

相关标签:
1条回答
  • 2021-01-25 09:16

    If you make use of get_template_part() you shoudn't have any issues.

    The way you probably included your modals.php was probably calling wp_footer() for some reason.

    so if you wanna use this template you just need to call it within the respective file you want it to.

    header.php single.php footer.php

    Are such template default files. Within one of those just call it.

    <?php 
        get_template_part('modals.php'); 
    
        // Just in case you wanna use a variable from another context into this template. 
        $post_id = 930;
        include(locate_template('modals.php'));
    ?>
    

    Other than that i don't think their should be an issue it not working.

    Tell me if it fixes your issues, maybe paste the code context where the modals.php is being called and how its being called.

    0 讨论(0)
提交回复
热议问题