Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将类应用于PHP行?_Php_Html_Wordpress_Themes - Fatal编程技术网

如何将类应用于PHP行?

如何将类应用于PHP行?,php,html,wordpress,themes,Php,Html,Wordpress,Themes,我有个头球 并且希望添加class=sticky,这样当它被解析为HTML时,它将读取打开header.php文件并将sticky类添加到 <header id="masthead" class="site-header" role="banner"> 功能 包括当前主题目录中的header.php模板文件 编辑 jQuery 您应该编辑header.php模板文件谢谢@Howlin,所以我不能在page.php中执行任何操作?我不想更改主标题属性,只想更改page.php的标题。

我有个头球
并且希望添加class=sticky,这样当它被解析为HTML时,它将读取打开header.php文件并将sticky类添加到

<header id="masthead" class="site-header" role="banner">
功能

包括当前主题目录中的header.php模板文件

编辑 jQuery


您应该编辑header.php模板文件谢谢@Howlin,所以我不能在page.php中执行任何操作?我不想更改主标题属性,只想更改page.php的标题。您可以使用jquery添加它,我不这么认为。
<script type="text/javascript">
$(document).ready(function()
{
    $("header").addClass("sticky");
});
</script>