wordpress MW WP Form 住所自動入力
・functions.php
// MW WP form function ajaxzip3_scripts() { wp_enqueue_script( 'ajaxzip3-script', 'https://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3-https.js', array( 'jquery' ), '20140807', true ); } add_action( 'wp_enqueue_scripts', 'ajaxzip3_scripts' );
・page.php
<?php $url = $_SERVER['REQUEST_URI']; ?> <?php if(strstr($url,'page-174')): ?> <script type='text/javascript' src="<?php echo get_template_directory_uri(); ?>/js/inquiry.js"></script> <?php elseif(strstr($url,'page-184')): ?> <script type='text/javascript' src="<?php echo get_template_directory_uri(); ?>/js/inquiry2.js"></script> <?php endif; ?>
・page2.php
<?php $url = $_SERVER['REQUEST_URI']; ?> <?php if(strstr($url,'page-174') || strstr($url,'page-184')): ?>111 <script type='text/javascript' src='https://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3-https.js'></script> <?php if(strstr($url,'page-174')): ?>222 <script type='text/javascript' src="<?php echo get_template_directory_uri(); ?>/js/inquiry.js"></script> <?php elseif(strstr($url,'page-184')): ?>333 <script type='text/javascript' src="<?php echo get_template_directory_uri(); ?>/js/inquiry2.js"></script> <?php endif; ?> <?php endif; ?>