- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在这里,我试图在 wordpress 主题中转换我的 html 和 css 模板,我有四个 php 文件 (1) index.php,(2) header.php,(3) feature.php 和 (4) footer.php .
在 index.php 文件中,我使用函数 <?php get_header(); ?>, <?php get_feature (); ?>,<?php get_footer (); ?>
获取其他三个文件.
现在开始使用函数 <?php get_header(); ?>,<?php get_footer (); ?>
在 index.php 中,它显示了页眉和页 footer 分,但包含了 <?php get_feature (); ?>
在页眉和页脚之间显示错误指示 <?php get_feature (); ?>
行说“ fatal error :在第 2 行调用 C:\xampp\htdocs\Alvin Lemo\wordpress\wp-content\themes\alvinlimo\index.php 中的未定义函数 get_feature()”并且不显示功能部分和页 footer 分。
下面是我做的
在 index.php 中
<?php get_header (); ?>
<?php get_feature(); ?> <!--- Error Showing Line -->
<?php get_footer (); ?>
在 header.php 中
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<!--- Basic Page Needs
================================================== -->
<meta charset="utf-8">
<title>Alvin Lemo</title>
<meta name="description" content="">
<meta name="author" content="">
<!-- Mobile Specific Metas
================================================== -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Abel" rel="stylesheet">
<!-- Script
================================================== -->
<script src="js/modernizr.js"></script>
<!-- Favicons
================================================== -->
<link rel="shortcut icon" href="favicon.png" >
<?php wp_head (); ?>
</head>
<body>
<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()" style="margin-top:30px;">×</a>
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Login To Resere Your Fleet With Us</h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<div class="checkbox">
</div>
<button type="submit" class="btn btn-default">Rserve</button>
</form>
</div>
</div>
</div>
<div id="myNavv" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNavv()" style="margin-top:30px;">×</a>
<div class="overlay-content">
<div class="container">
<h2 style="color:white">Please Register To Reserve Your Fleet </h2><br />
<form>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter FullName"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="email" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter email"><br /><br />
</div>
<div class="form-group">
<input class="form-control" id="pwd" style="width:50%;height:40px;color:black;border-radius:4px;font-size:18px" placeholder="Enter password"><br /><br />
</div>
<button type="submit" class="btn btn-default">Register</button>
</form>
</div>
</div>
</div>
<!-- Header
================================================== -->
<header>
<div class="logo">
<a class="smoothscroll" href="#hero"><!--<img alt="" src="images/logo.png">-->
<h2>A.L.S</h2>
</a>
</div>
<nav id="nav-wrap">
<a class="mobile-btn" href="#nav-wrap" title="Show navigation">Show Menu</a>
<a class="mobile-btn" href="#" title="Hide navigation">Hide Menu</a>
<ul id="nav" class="nav">
<li><a class="smoothscroll" href="#features">EVENT TRANSPORTATION</a></li>
<li><a class="smoothscroll" href="#pricing">Services</a></li>
<li><a class="smoothscroll" href="#screenshots">OUR FLEET</a></li>
<li><a class="smoothscroll" href="#testimonials">Testimonials</a></li>
<li><a class="smoothscroll" href="#subscribe">CONTACT</a></li>
</ul> <!-- end #nav -->
</nav> <!-- end #nav-wrap -->
<ul class="header-social">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-google-plus"></i></a></li>
</ul>
</header>
<!-- Header End -->
<!-- Homepage Hero
================================================== -->
<section id="hero">
<div class="row">
<div class="twelve columns">
<div class="hero-text">
<br /><br /><br />
<h1 class="responsive-headline">Welcome To Alvin's Limo</h1>
<p>
Little about alivin's limo services.
</p>
</div>
<br />
<div class="buttons">
<a class="button trial" onclick="openNav()">Reserve Fleet</a>
<a class="button learn-more smoothscroll" onclick="openNavv()">Register</a>
</div>
<br /><br /><br /><br /><br /><br /><br />
</div>
</div>
</section>
<!-- Homepage Hero end -->
在 feature.php 中
<!-- Features Section
================================================== -->
<section id='features'>
<div class="row section-head">
<h1>EVENT TRANSPORTATION</h1>
<p>
We Fell Happy To Be Part Of Your Special Ocassion
</p>
</div>
<div class="row feature design">
<div class="six columns right">
<h3> Wedding Transporation</h3>
<p>LMake your "most memorable day" of your life more special by Alvin Wedding Limo Service.
Your weddings transportation will be most beautiful latest model limousine imaginable,
with all the special amenities you desire. Our chauffeurs are always on time, courteous,
and dressed in black suit. Let us take you to the church and from the church to the reception and
from the reception to the airport or any special place in Texas for your honeymoon. You don't need
to worry about coordinating transportation from each destination, we can help arrange your weddings
party pick-ups and drop-offs and everything in between. We do service all the hills country wedding
venues. Feel free to check our wedding reviews - WEDDINGWIRE-THE KNOTT.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/fpt-112704-Wedding-Flowers.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Wine Transportation.</h3>
<p>
Alvin Limousine Services share your passion for wine; that’s why we specialize in hills country
wine tours. We offer a diverse selection of vehicles ranging from sedans, stretch limousines to
transport you affordably in luxury, safety, and style! Leave the driving, directions, stress,
and traffic to us while our Chauffeur whisks you away to your perfect day!
Our impressive customer list is concrete evidence of our ability to outperform our competition,
consistently exceeding our customers’ expectations. We will make your tour the best tour you have
ever known. We have dedicated chauffeur that specialize in wine tours, Brewery and Vodka distillery.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/wine-tours-preferrred-limo.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Concert</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of,
Alvin Limos will provide you personal and reliable chauffeured Limousine.
Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride
from navigation, traffic, and struggling the multitude of cars for parking. Roll up with
style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert,
Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of
your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/thenextweb.jpg" />
<!--<img src="images/feature-image-3.png" alt="" />-->
</div>
</div>
<div class="row feature video">
<div class="six columns left">
<h3>ACL/SXSW/Austin 360</h3>
<p>
What you hear is true. With vibrant entertainment and culture, inspiring cuisine and stunning outdoor settings, Austin lets you create a soundtrack all your own. We're home to more than 250 music venues and a vibrant arts scene. So take a look around, and put Live Music Capital of the World® on your playlist. Whether you want to take ride thought Austin or plan a night out with friends and family we will do that in style. Alvin Limousine is a premier transportation when it comes to Austin Texas culture and events. Come one come all and let us drive though the ins and outs of this beautiful happening city.
Alvin Limousine staff are very discrete and confident with all our celebrities and movies stars that we have been transporting for years.
</p>
</div>
<div class="six columns feature-media right">
<img src="images/1ff7f709cd8ef280ec5f2b317f79ba14-2b32e6b5be7f48f4557299fc9db819c3.png" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Convention Center</h3>
<p>
The Austin Convention Center, a premier facility located in the heart of the capital city’s downtown business district, has emerged as a leader in the convention and meeting industry.
Alvin’s Limousine Services is proud to be part of your success by providing you or your guests with a premier chauffeured services . We can accommodate small or large groups .
- Airport Transportations
- Shuttling your groups through out your meetings
- Advertising your business on our Cars. (Wrap the cars with your Logo or new Product.**Extra Fees apply)
</p>
</div>
<div class="six columns feature-media left">
<img src="images/ARATA_ISOZAKI_RHWL_QNCC_DOHA_QATAR_PAN_060313_0009.jpg" />
</div>
</div>
<div class="row feature responsive">
<div class="six columns left">
<h3>Circuits of America - Formula 1</h3>
<p>
Circuit Of The Americas is a multi-purpose facility that will host the most prestigious racing events in the world, including the Formula 1 United States Grand Prix. It is the first purpose-built Grand Prix facility in the U.S Austin Texas
Circuit of The Americas (COTA) in Austin, Texas, is the home of world championships and a world-class destination for premium sports and entertainment.
Alvin’s Limousine Services is proud to be the leading transportations in Austin Texas, we can provide you or your Guests with many VIP Packages that can suits your needs , from Town car service , SUV’s or Stretch Limousine ,we are your one stop solutions to your transportations for World-Class destination . For International reservations , Please use our 24/7 reservations systems for quick quote and complete reservation confirmed within one hour or you can
Skpe us at : Austinlimo
</p>
</div>
<div class="six columns feature-media right">
<img src="images/bQwIzE.jpg" />
</div>
</div>
<div class="row feature cross-browser">
<div class="six columns right">
<h3>Prom</h3>
<p>
Whether you want to see a Show, Concert, Opera, Symphony or any other fun thing you can think of, Alvin Limos will provide you personal and reliable chauffeured Limousine. Reserve luxury town car Sedan or our luxurious stretch limousine for hassle free ride from navigation, traffic, and struggling the multitude of cars for parking. Roll up with style to the front door of any events location you desire.
Let the professional Chauffeurs of Alvin Limousine Service take you to your next Concert, Movie premier, Opera, Symphony or any night out events with comfort and style.
We get you there on time in safely and in style ; Alvin Limo will ensure you have the time of your life. We are the Leader in providing a full Service Limousine Transportation.
</p>
</div>
<div class="six columns feature-media left">
<img src="images/prom-header.jpg" />
</div>
</div>
</section>
<!-- Features Section end -->
在 footer.php 中
<!-- Footer
================================================== -->
<footer>
<div class="row">
<div class="six columns right-cols">
<div class="row">
<div class="columns">
<h2 class="address">Come Visit</h2>
<p>
7901 Cameron Rd Bldg3 Suite 312, Austin tx 78754<br>
</p>
</div>
<div class="columns last">
<h2 class="contact">Contact Us</h2>
<ul>
<li><a href="tel:6473438234">512 300 1379</a></li>
<li><a href="">someone@woosite.com</a></li>
</ul>
</div>
</div>
</div>
<p class="copyright">© 2014 Alvin's Limousine Services | Design by <a>cts-Design Team</a></p>
<div id="go-top">
<a class="smoothscroll" title="Back to Top" href="#hero"><i class="icon-up-open"></i></a>
</div>
</div> <!-- Row End -->
</footer>
<!-- Footer End-->
<?php wp_footer (); ?>
<!-- Java Script
================================================== -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2 /jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.10.2.min.js"><\/script>')</script>
<script type="text/javascript" src="js/jquery-migrate-1.2.1.min.js">
</script>
<script src="js/jquery.flexslider.js"></script>
<script src="js/waypoints.js"></script>
<script src="js/jquery.fittext.js"></script>
<script src="js/jquery.fitvids.js"></script>
<script src="js/imagelightbox.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js">
</script>
</body>
</html>
最佳答案
get_header() 和 get_footer() 等函数是预定义的 WordPress 函数。为了获得我们使用的模板的自定义部分
<?php get_template_part( string $slug, string $name = null ) ?>
如文档中所述,它用于查找文件的模式是:
如果主题不包含指定文件,则不会包含模板。
该模板是使用 require 而不是 require_once 包含的,因此您可以多次包含相同的模板部分。
最后,这应该加载您的功能模板:
<?php get_template_part( 'feature' ) ?>
来源:https://developer.wordpress.org/reference/functions/get_template_part/
关于php get函数在wordpress中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40839517/
C语言sscanf()函数:从字符串中读取指定格式的数据 头文件: ?
最近,我有一个关于工作预评估的问题,即使查询了每个功能的工作原理,我也不知道如何解决。这是一个伪代码。 下面是一个名为foo()的函数,该函数将被传递一个值并返回一个值。如果将以下值传递给foo函数,
CStr 函数 返回表达式,该表达式已被转换为 String 子类型的 Variant。 CStr(expression) expression 参数是任意有效的表达式。 说明 通常,可以
CSng 函数 返回表达式,该表达式已被转换为 Single 子类型的 Variant。 CSng(expression) expression 参数是任意有效的表达式。 说明 通常,可
CreateObject 函数 创建并返回对 Automation 对象的引用。 CreateObject(servername.typename [, location]) 参数 serv
Cos 函数 返回某个角的余弦值。 Cos(number) number 参数可以是任何将某个角表示为弧度的有效数值表达式。 说明 Cos 函数取某个角并返回直角三角形两边的比值。此比值是
CLng 函数 返回表达式,此表达式已被转换为 Long 子类型的 Variant。 CLng(expression) expression 参数是任意有效的表达式。 说明 通常,您可以使
CInt 函数 返回表达式,此表达式已被转换为 Integer 子类型的 Variant。 CInt(expression) expression 参数是任意有效的表达式。 说明 通常,可
Chr 函数 返回与指定的 ANSI 字符代码相对应的字符。 Chr(charcode) charcode 参数是可以标识字符的数字。 说明 从 0 到 31 的数字表示标准的不可打印的
CDbl 函数 返回表达式,此表达式已被转换为 Double 子类型的 Variant。 CDbl(expression) expression 参数是任意有效的表达式。 说明 通常,您可
CDate 函数 返回表达式,此表达式已被转换为 Date 子类型的 Variant。 CDate(date) date 参数是任意有效的日期表达式。 说明 IsDate 函数用于判断 d
CCur 函数 返回表达式,此表达式已被转换为 Currency 子类型的 Variant。 CCur(expression) expression 参数是任意有效的表达式。 说明 通常,
CByte 函数 返回表达式,此表达式已被转换为 Byte 子类型的 Variant。 CByte(expression) expression 参数是任意有效的表达式。 说明 通常,可以
CBool 函数 返回表达式,此表达式已转换为 Boolean 子类型的 Variant。 CBool(expression) expression 是任意有效的表达式。 说明 如果 ex
Atn 函数 返回数值的反正切值。 Atn(number) number 参数可以是任意有效的数值表达式。 说明 Atn 函数计算直角三角形两个边的比值 (number) 并返回对应角的弧
Asc 函数 返回与字符串的第一个字母对应的 ANSI 字符代码。 Asc(string) string 参数是任意有效的字符串表达式。如果 string 参数未包含字符,则将发生运行时错误。
Array 函数 返回包含数组的 Variant。 Array(arglist) arglist 参数是赋给包含在 Variant 中的数组元素的值的列表(用逗号分隔)。如果没有指定此参数,则
Abs 函数 返回数字的绝对值。 Abs(number) number 参数可以是任意有效的数值表达式。如果 number 包含 Null,则返回 Null;如果是未初始化变量,则返回 0。
FormatPercent 函数 返回表达式,此表达式已被格式化为尾随有 % 符号的百分比(乘以 100 )。 FormatPercent(expression[,NumDigitsAfterD
FormatNumber 函数 返回表达式,此表达式已被格式化为数值。 FormatNumber( expression [,NumDigitsAfterDecimal [,Inc
我是一名优秀的程序员,十分优秀!