Wordpress doesnt proces external php file -


i making attempt write own theme wordpress , have written file contains modals (twitter bootstrap), html. added theme section (created inc folder) , named modals.php.

i included via php everywhere in page need modals. works. whenever click on link, modal loads. however, when start adding php modals, breaks. modal being loaded, instead of requested post item wordpress database (i use make dynamic content, since multi language), loads footer, , breaks website, confusing me really.

my modals.php contains following

<div id="about" class="modal fade" tabindex="-1">     <div class="vertical-alignment-helper">         <div class="modal-dialog vertical-align-center">             <div class="modal-content">                 <div class="modal-header">                     <button class="close" type="button" data-dismiss="modal"></button>                     <button class="close" type="button" data-dismiss="modal">x<span class="sr-only">close</span></button>&nbsp;                     <h4 id="mymodallabel" class="modal-title">                         modal popup                     </h4>                 </div>                 <div class="modal-body modal-list">                     <div class="modal-content col-md-12">                         <strong><?php _e(" <!--:en-->it's me<!--:--><!--:pl-->to ja<!--:-->" ); ?> </strong>                             <p>                                 <?php                                     $post = get_post(930);                                      $content = $post->post_content;                                     echo $content;                                 ?>                               </p>                     </div>                 </div>                 <div class="modal-footer"><button class="btn btn-default" type="button" data-dismiss="modal">close</button>                 </div>             </div>         </div>     </div> </div> 

do need tell file needs read wordpress specific, or need add file somewhere in order make read?

edit

as tried echo'ing words test , works, have feeling has syntax wordpress uses. there way make wordpress known should read wordpress syntax?

edit 2

at moment, having multiple subpages, want load modals page. gdynia, want load those. updated code , have this.

else if (is_page ('gdynia')) {         get_template_part('modals-gdynia.php');  } 

yet nothing happens now. used be,

else if (is_page ('gdynia')) {     include_once(get_template_directory_uri() .'/modals-gdynia.php'); } 

if make use of get_template_part() shoudn't have issues.

the way included modals.php calling wp_footer() reason.

so if wanna use template need call within respective file want to.

header.php single.php footer.php

are such template default files. within 1 of call it.

<?php      get_template_part('modals.php');       // in case wanna use variable context template.      $post_id = 930;     include(locate_template('modals.php')); ?> 

other don't think should issue not working.

tell me if fixes issues, maybe paste code context modals.php being called , how being called.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -