阅读本
融入你的WordPress网站PunBB
在这个职位的详细信息是很老,但我要离开这里,以供参考,不管... ...
我想添加一个论坛,我的WordPress博客,但我遇到也没有整合进来的一切(设计/页的连续性等),或对我的口味太简单... ...然后,我来到过这里的教程(有周围几个,这只是我绊倒横跨一个)。 本教程之后,我有一个较为完整的论坛...
... ...我们屠宰场的血飞溅,不会弄脏什么... ...
随着经验教训和PunBB 1.2.15的发布,我决定看看我是否能做得更好。 自第一次安装/集成,我增加了一个基于CSS的导航菜单和一些随机的报价没有显示时,我的旗帜/头以上PunBB论坛显示。
恼火,我拿起剪刀,开始运行 ... ... 。
这整个过程中很重要的是我安装PunBB。 我选择了/ wp-content/myforums。 如果你选择安装在不同的位置/路径,只是相应地修改我的例子,然而,你可能会遇到的问题,如果你移出“WordPress的目录(因人而异)。
由于我没有要重新设计或定制PunBB任何必要,我用自己的模板系统,以及他们包括/用户功能(允许用户“包括”自己的PHP脚本/页)。
首先,我要按摩到2个文件,我命名head.php和body.php,所以没有任何的DOCTYPE重复和将严格有效的XHTML,我的WordPress主题的header.php文件。 关于现在是你的头/ php文件复制到一个地方,我们屠宰场的血飞溅,不会弄脏任何一个好时机。
下面将只在版本低于2.3
随着2.3,我不得不删除所有呼叫功能可湿性粉剂 。
- 删除所有行(header.php文件的顶部),请
<!DOCTYPE <htmlHTML<head头(因为这些重复PunBB 1.2.15已经发送) - 在它的位置,在顶部添加:
<?php require('../../wp-blog-header.php'); ?>(这允许使用我们的WordPress的功能) - 向下滚动到
</head>头闭幕)标记并删除它,一切通过文件的其余部分如下。 - 将它保存为/ wp-content/myforums/include/user/head.php
- 重新打开原始的,未经编辑header.php文件(我们上面使用的相同)
- 删除一切,从1号线,一路过关斩将,包括
<body>标签的 - 现在保存为/ wp-content/myforums/include/user/body.php
- 现在打开你的主题footer.php
- 向下滚动到文件的末尾,并删除任何参考结束标记
</body></html> - 现在保存为/ wp-content/myforums/include/user/foot.php
- 现在打开/ wp-content/myforums/include/template/main.tpl
- 后含有
<pun_head>行,但前</head>>插入行<pun_include "head.php">"head.php"> - 然后,在含线
<body>,但前<div id="punwrap">id="punwrap">插入行<pun_include "body.php">"body.php"> - 最后,在
</div></body><pun_include "foot.php"> </div>2关闭,但在此之前插入行<pun_include "foot.php">"foot.php"> - 最后,我杀了PunBB
<title><title>打开/ wp-content/myforums/header.php注释掉此行#79:<!-- <title><?php echo $page_title ?></title> -->-<!-- <title><?php echo $page_title ?></title> -->
等完事大吉!
我发现PunBB极小主题的工作为我的网站最好的,但整合上述步骤后,我仍然发现恼人的边界痕迹,所以我开/ wp-content/myforums/style/imports/Minima_cs.css和改变#brdmenu边框宽度:元素/属性边框宽度:0;
我还发现PunBB'头'(箱,连同顶部的水平NAV链接)很笨拙,所以我评论说出来,有效地。
下面是原main.tpl:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="<a href="http://www.w3.org/1999/xhtml>/a>
<pun_content_direction>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
<pun_head>
</head>
<body>
<div id="punwrap">
<div id="pun<pun_page>" class="pun">
<div id="brdheader" class="block">
<div class="box">
<div id="brdtitle" class="inbox">
<pun_title>
<pun_desc>
</div>
<pun_navlinks>
<pun_status>
</div>
</div>
<pun_announcement>
<pun_main>
<pun_footer>
</div>
</div>
</body>
</html>
和我的成品/ wp-content/myforums/include/template/main.tpl:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " <html xmlns="<a href="http://www.w3.org/1999/xhtml">
<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<pun_char_encoding>" />
<pun_head>
<pun_include "head.php">
</head>
<body>
<pun_include "body.php">
<div id="punwrap">
<div id="pun<pun_page>" class="pun">
<!-- <div id="brdheader" class="block">
<div class="box">
<div id="brdtitle" class="inbox">
<pun_title>
<pun_desc>
</div>
<pun_navlinks>
<pun_status>
</div>
</div> -->
<pun_navlinks>
<pun_status>
<pun_announcement>
<pun_main>
<pun_footer>
</div>
</div>
<pun_include "foot.php">
</body>
</html>
我认为这与我的主题( 很好巴塞尔姆),它是(?)的XHTML有效的。
与其他主题结合起来,可能需要不同的“微调”,但本教程,你应该在球场。
一如往常,欢迎反馈!
3用户评论到你的WordPress网站上的“整合PunBB”
喂? 所有的代码丢失。 打开你的<code>但没有如下,和结束标记丢失。
可能会很高兴见到你做了什么。 行吗?
柯克帕特里克:感谢,指出这一点,在一些点格式的代码,是错位...
应该是所有现在好多了。































