我正在使用自定义页面模板,并在
<!--Content Row-->
评论后包含 jQuery Validation Engine 插件,代码如下
<?php get_header(); ?>
<?php //Template Name:test ?>
<div class="wrap">
<!-- Slider -->
<?php AwesomeSlider(); ?>
<?php
$titleType = get_post_meta(get_the_ID(), 'intro_type', true);
$pageTitle = '';
$pageDesc = '';
switch ($titleType) {
case "2":
$pageTitle = get_post_meta(get_the_ID(), 'intro_title', true);
break;
case "3":
{
$pageTitle = get_post_meta(get_the_ID(), 'intro_title', true);
$pageDesc = get_post_meta(get_the_ID(), 'intro_desc', true);
break;
}
default:
$pageTitle = get_the_title();
break;
}
?>
<!--Intro-->
<?php if($titleType != '4'){ ?>
<div id="wrap_intro" >
<div class="container">
<div class="intro">
<h1><?php echo $pageTitle; ?></h1>
<h3><?php echo $pageDesc; ?></h3>
</div>
</div>
</div>
<?php } ?>
<!--Content-->
<div id="wrap_main" >
<div class="top_left"></div>
<div id="main" class="container">
<!--Content Row-->
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/validationEngine.jquery.css" type="text/css"/>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/languages/jquery.validationEngine-en.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.validationEngine.js"></script>
<script>
jQuery(document).ready(function(){
jQuery("#formID").validationEngine('attach');
});
</script>
<form id="formID" class="rmular" method="post" action="">
<fieldset>
<legend>
IP Address
</legend>
<label>
<span>IP: </span>
<input value="192.168.3." class="validate[required,custom[ipv4]] text-input" type="text" name="ip" id="ip" />
</label>
</fieldset><input class="submit" type="submit" value="Validate & Send the form!"/><hr/>
</form>
<div class="row">
<?php
$pageClass = 'span9';
if(opt('sidebar_position') == 0)
$pageClass = 'span12';
if(opt('sidebar_position') == 1)
$pageClass .= ' blog_right';
?>
<div class="<?php echo $pageClass; ?>">
<?php
if (have_posts()) { while (have_posts()) { the_post();
?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> >
<?php the_content(); ?>
</div>
<?php
}//While have_posts
}//If have_posts
?>
<!--Comments-->
<?php comments_template('', true); ?>
</div>
<!--Sidebar-->
<?php
if(opt('sidebar_position') != 0)
get_sidebar();
?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
我已经尝试了所有方法,但似乎无法弄清楚如何使其工作,我还检查了相同情况下的其他 stackoverflow 答案,但是他们告诉我在我的代码中找不到它们的错误,请帮助我,因为我需要 IPV4验证我的网站,我似乎无法弄清楚它为什么不起作用。