---
title: "wordpress"
author: "splayx"
date: "2014-03-16T11:51:47Z"
tags: []
categories: ["非技术"]
slug: "wordpress"
draft: false
lastmod: "2015-08-13T16:51:33Z"
id: 2031674
url: "https://splayx.iteye.com/blog/2031674"
---

使用

## Crayon Syntax Highlighter插件

&lt;pre&gt;粘贴code在这里&lt;/pre&gt;

 

数据库备份和恢复

mysqldump -u root -p mytest &gt; mytest.sql

mysql -u root -p mytest &lt; mytest.sql

 

删掉关于标题，在twentytwelve/content-page.php中，删掉一下代码

```
<header class="entry-header">
			<?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
			<?php the_post_thumbnail(); ?>
			<?php endif; ?>
			<h1 class="entry-title"><?php the_title(); ?></h1>

		</header>
```

 

在twentytwelve/header.php中加入红色代码，注意放其他位置会导致布局变形，不知为啥。

 &lt;head&gt;

&lt;meta charset="&lt;?php bloginfo( 'charset' ); ?&gt;" /&gt;

&lt;link rel="stylesheet" href="http://www.xxx.com/stackedit/public/res-min/themes/base.css"/&gt;

&lt;meta name="viewport" content="width=device-width" /&gt;

&lt;title&gt;&lt;?php wp\_title( '|', true, 'right' ); ?&gt;&lt;/title&gt;

&lt;link rel="profile" href="http://gmpg.org/xfn/11" /&gt;

&lt;link rel="pingback" href="&lt;?php bloginfo( 'pingback\_url' ); ?&gt;" /&gt;

&lt;?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?&gt;

&lt;!--\[if lt IE 9]&gt;

&lt;script src="&lt;?php echo get\_template\_directory\_uri(); ?&gt;/js/html5.js" type="text/javascript"&gt;&lt;/script&gt;

&lt;!\[endif]--&gt;

&lt;?php wp\_head(); ?&gt;

&lt;/head&gt;

 

在twentytwelve/content.php中把这段代码删，就可以把摘要中那个碍眼的评论去掉。

```
<?php if ( comments_open() ) : ?>
				<div class="comments-link">
					<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
				</div><!-- .comments-link -->
			<?php endif; // comments_open() ?>
```

 

在twentytwelve/footer.php中把footer的代码改成，就可以改掉原版的那句土话了，顺便加上copyright。

```
<footer id="colophon" role="contentinfo">
		<div class="site-info">
			<?php do_action( 'twentytwelve_credits' ); ?>
<p>Copyright © 2013-2014</p>
		</div><!-- .site-info -->
	</footer>
```

 

去除“您可以使用这些HTML标签和属性：”的方法，

 在wp-includes/comment-template.php寻找代码&lt;?php echo $args\['comment\_notes\_after']; ?&gt;，并删了。

 

主页只显示摘要：

在twentytwelve/content.php中增加红色代码

&lt;?php if ( is\_search() || is\_home()) : // Only display Excerpts for Search ?&gt;