I love WordPress Recent Comments Are Not Displayed in their Records

Recently many friends comments on my blog, I love WP in reply to a number of messages and found that the recent comments modules have become their message

I love WP log blog back in the background, I love WordPress is not logged in the blog replies, if the block would be nice.

Now I have to record my changes to the process, because by default, the administrator ID is generally 1, so we just exclude the ID of the user’s comments and comments on it, in WordPress user_id! = 1 is excluded Administrator information for messages and comments:

Find the sidebar recent comments code

In this code, add

1  AND user_id !=1

Reply Administrator removed the background part of administrator’s reply is not removed at the front desk, this is not the effect we want, we modify the login user name to this directory, modify the code again,

1 AND user_id !=1

change into:

1 AND comment_author!='我爱WP' AND comment_author!='我爱WordPress'

Means to exclude I love WP and I love WordPress comments

According to this principle, you can continue to use comment_author_email field, in short, is to prohibit anyone who forbid ah!

 

WordPress Custom Sidebar Gadget

WordPress theme gadgets, you can freely drag the sidebar, and in the foreground to achieve the corresponding function! But the theme that comes with gadgets often can not meet our more powerful needs, how to follow, look at how to customize the sidebar gadget!

We first need to understand a number of conceptual things, if you do not want to know you can skip directly, no harm to the back of the gadget to create understanding! WordPress provides a WP_Widget class, we only need to extend the WP_Widget class, you can create your own widget , such files are located in wp-includeswidgets.php, braised look boring!

The following little tool with examples of production processes, example gadget function call specifies the classification of the article! Start below:

Create a new file cat_posts.php, and introduce the file in the theme functions.php! cat_posts.php mainly consists of the following sections:

1. Custom extension type

First of all, the definition of a WP_Widget expansion category, class name, but not with other class name conflict, such as catPostsWidget, at the same time constructor.

 1 class catPostsWidget extends WP_Widget {
 2 /*
 3 ** 声明一个数组$widget_ops,用来保存类名和描述,以便在主题控制面板
   确显示小工具信息
 4 ** $control_ops 是可选参数,用来定义小工具在控制面板显示的宽度和高度
 5 ** 最后是关键的一步,调用WP_Widget来初始化我们的小工具
 6 **/
 7 function catPostsWidget(){
 8 $widget_ops = array('classname'=>'widget_random_posts',
   'description'=>'随机显示你博客中的文章');
 9 $control_ops = array('width'=>250,'height'=>300);
10 $this->WP_Widget(false, '分类文章调用', $widget_ops, $control_ops);
11 }
12 }

Note: the constructor catPostsWidget () two array variables are defined in $widget_ops and $control_pos, is passed to $this->WP_Widget () for initialization of the widget.

WP_Widget parameter details:

The first parameter is $id_base, we normally set to false, you can also use the gadget name, such as ‘catPostsWidget’;

The second parameter specifies the name that the gadget displays;

The third parameter specifies the name and description of the gadget, effects that combine both of these parameters are as follows

Fourth parameter defines the widget’s width and height, usually only the first three parameters are required to, effect of it is that when you drag the gadget to the sidebar of the width and height.

2. Three important functions of extension classes

Gadgets extension class you need to define three important functions: form (), the update (), widget ()

Form () function is used to display gadgets in General option setting for the form, the form content according to the needs of their own definition, the sample gadget defines four options for setting:
Title: module title can be set to the default value, such as “category”;

Title_en: English title can be set to the default value, such as “Title”;

NUM: displays the number of articles, you can set the default value, such as 10;

Cat: category ID, and can be set to the default value, such as 0, which displays all the categories under article

Background display:

Form () function code:

 1 function form($instance){
 2 //title:模块标题,title_en:英文标题,showPosts:显示文章数量,
   cat:分类目录ID
 3 $instance = wp_parse_args((array)$instance,array('title'=>'分类文
   章','title_en'=>'Title','showPosts'=>10,'cat'=>0));//默认值
 4 $title = htmlspecialchars($instance['title']);
 5 $title_en = htmlspecialchars($instance['title_en']);
 6 $showPosts = htmlspecialchars($instance['showPosts']);
 7 $cat = htmlspecialchars($instance['cat']);
 8 echo '<p style="text-align:left;"><label for="'.$this-
   >get_field_name('title').'">标题:<input style="width:200px;" 
   id="'.$this->get_field_id('title').'" name="'.$this-
   >get_field_name('title').'" type="text" value="'.$title.'" />
   </label></p>';
 9 echo '<p style="text-align:left;"><label for="'.$this-
   >get_field_name('title_en').'">英文标题:<input style="width:200px;" 
   id="'.$this->get_field_id('title_en').'" name="'.$this-
   >get_field_name('title_en').'" type="text" value="'.$title_en.'" />
   </label></p>';
10 echo '<p style="text-align:left;"><label for="'.$this-
   >get_field_name('showPosts').'">文章数量:<input style="width:200px;" 
   id="'.$this->get_field_id('showPosts').'" name="'.$this-
   >get_field_name('showPosts').'" type="text" value="'.$showPosts.'" 
   /></label></p>';
11 echo '<p style="text-align:left;"><label for="'.$this-
   >get_field_name('cat').'">分类ID:<input style="width:200px" 
   id="'.$this->get_field_id('cat').'" name="'.$this-
   >get_field_name('cat').'" type="text" value="'.$cat.'" /></label>
   </p>';
12 }

 

Set 4 $instance array in the form key:title, and title_en and the showPosts, and cat (freely definable key name), and then by the WordPress function get_field_name and get_field_id settings are saved in the form in the appropriate array Key.

Update () function to update the saved form () set of data is passed to the form.

1 function update($new_instance,$old_instance){
2 $instance = $old_instance;
3 $instance['title'] = 
  strip_tags(stripslashes($new_instance['title']));
4 $instance['title_en'] = 
  strip_tags(stripslashes($new_instance['title_en']));
5 $instance['showPosts'] = 
  strip_tags(stripslashes($new_instance['showPosts']));
6 $instance['cat'] = strip_tags(stripslashes($new_instance['cat']));
7 return $instance;
8 }

 

1 function update($new_instance,$old_instance){
2 $instance = $old_instance;
3 $instance['title'] =
  strip_tags(stripslashes($new_instance['title']));
4 $instance['title_en'] = 
  strip_tags(stripslashes($new_instance['title_en']));
5 $instance['showPosts'] = 
  strip_tags(stripslashes($new_instance['showPosts']));
6 $instance['cat'] = strip_tags(stripslashes($new_instance['cat']));
7 return $instance;
8 }

Note: the function definition can be omitted, the $new_instance is returned by default, which means that changes you make in the widget options can be saved, but in order to ensure the security of your data in the form, we can define and use the PHP function strip_tags and strip slashes to filter the input characters that are not valid.

Widget () function defines the widget displayed in the front page style

 1 function widget($args, $instance){
 2 extract($args);
 3 $title = apply_filters('widget_title', empty($instance['title']) ?
   __('分类文章Title','yang') : $instance['title']);//小工具前台标题
 4 $title = $title . ''.$instance['title_en'].'';
 5 $showPosts = empty($instance['showPosts']) ? 10 : 
   $instance['showPosts'];
 6 $cat = empty($instance['cat']) ? 0 : $instance['cat']; echo 
   $before_widget;
 7 if( $title ) echo $before_title . $title . $after_title; $query = 
   new WP_Query("cat=$cat&showposts=$showPosts&orderby=rand");
 8 if($query->have_posts()){
 9 echo '<ul>';
10 while($query->have_posts()){
11 $query->the_post();
12 echo '<li><a href="'.get_permalink().'">'.get_the_title().'</a>
   </li>';
13 }
14 echo '</ul>';
15 } echo $after_widget;
16 }

First use the extract function to convert the array keys into variables, and then removed from the $ instance to save the value of each key, and then output the article list style can be.

The front effect is as follows:

Registration widgets

At this point, custom widget class catPostsWidget has been defined, and finally we need a step: Register the gadget class to complete the activation of the gadget.

1 register_widget('catPostsWidget');

Note: The activation code is placed outside the class definition.

OK, so completely, you don’t get a custom one!!

Article Source: http: //www.nuodou.com/a/856.html

 

No Plug-ins Automatically Display WordPress Thumbnails

I love WP received recommendations from friends, the best Home page to display with a picture, I am here to bring Home title a thumbnail, no plug-in, pure code is how to achieve Home article thumbnail, the method is very simple, even if you don’t understand the code, just follow the steps. Of course, the thumbnail select the first picture in the article, if the article does not contain a picture, it will display the default picture, so you have to select a default picture location.

Step 1: Locate the functions.php file for the theme template you are using. Add the following code between <? Php and?>

 1 function thumb_img($soContent){ $soImages = '~<img [^\>]*\ />~';
 2 preg_match_all( $soImages, $soContent, $thePics );
 3 $allPics = count($thePics[0]);
 4 if( $allPics > 0 ){
 5 echo "<span id='thumb'>";
 6 echo $thePics[0][0];
 7 echo '</span>';
 8 }
 9 else {
10 echo "<span id='thumb'>";
11 echo "<img src='";
12 echo bloginfo('template_url');
13 echo "/images/thumb.gif'></span>";
14 }
15 }

This is a thumbnail display method that automatically retrieves the first image of the article, if you do not see the current theme/images/thumb.gif, you have to make this thumb.gif available.

Step 2: Find the index.php file that is the first page of the document, find the_content () or similar code in it before adding the following code:

1 thumb_img($post->post_content);

This call has just the method, in fact, the thumbnail has been completed! But you see the effect must be very unexpected, the size of the picture should beyond control, it will be difficult to see … Well, the third step

Step 3: add thumbnail style CSS code:

This is 52wordpress the thumbnail of the style to use, you can do the first, then further modify it.

1 #thumb{margin:5px 15px 5px 5px;width:145px;height:120px;border:3px 
  solid #eee;float:left;overflow:hidden;}
2 #thumb img{max-height:186px;max-width:186px}

Well, thumbnail mode is kind of show up! Three-step to achieve!

Screenshots for everyone to look at the results:

 

52wp 无插件自动显示WordPress缩略图

Effect is this, next I love WP will further modify the CSS to improve it.

 

Further Modification of WordPress Thumbnails

I love WP last modified thumbnail is not too ideal, images do not display in the middle, so they look for alternative code, the test is successful, records are as follows:

Step 1: Find the function.php file in your theme template folder. If not on a new one.

 1 function thumb_img($soContent){ 
 2 $soImages = '~<img [^\>]*\ />~'; 
 3 preg_match_all( $soImages, $soContent, $thePics ); 
 4 $allPics = count($thePics[0]); 
 5 if( $allPics > 0 ){ 
 6 echo "<span id='thumb'>"; 
 7 echo $thePics[0][0]; 
 8 echo '</span>'; 
 9 } 
10 else { 
11 echo "<span id='thumb'>"; 
12 echo "<img src='"; 
13 echo bloginfo('template_url'); 
14 echo "/images/nopic.jpg'></span>"; 
15 } 
16 }

The above code in the function.php file <?php and? >, of course, if you don’t have the file you will have to create the file, write the code above red!

1 <div class="post-img"> <a href="<?php the_permalink() ?>"
  rel="bookmark" target="_blank" title=" <?php the_title_attribute(); 
  ?>" class="png"><?php echo thumb_img($post->post_content); ?> </a> 
  </div>

Above post_content);?> Thumbnail is the function of the article picture shows!

Step 3: Add thumbnail style CSS code:

Open the style.css file. At the end, add the following CSS code:

1 .post-img{float:left;margin-right:15px} 
2 .post-img{height:185px;width:260px} 
3 .post-img a{height:185px;width:260px} 
4 .post-img img{height:185px;width:260px}

After completing the above three-step function is achieved.

Note here is the CSS style to adjust their own, I clear the floating div blocks, without distortion, according to the changes to the template.

Effect screenshots is as follows:

52dff 进一步修改Wordpress缩略图

 

WordPress Tags Advanced Usage and its Relation with SEO

Using WordPress  to build friends, label is all too familiar. The use of labels also have their own views, mainly concentrated in two points: one is inclined to shield, and the other is not shielded. Tend to shield with the number of articles is the reason for the label will be more and more, resulting in the site to be bloated; unshielded reason is that the tag is conducive to search engines. I believe that this tag should not be shielded, WordPress as one of the largest blog program, has its natural beauty. The author made a list and commentary on popular usage and provides an advanced usage, and users to share.

First, fancy tag cloud

Remember many years ago, when not using WordPress, seen a lot of Netizen’s blog, a tag cloud in sidebar, some kind of dynamic clouds. I use the CMS system, and looking to achieve the same functionality without ending, then I know was using WordPress, and a tag cloud plugin. It now appears that this is nothing. This float features, in fact, is a flashy features, for users, more important is access speed, for the general case of slow speed to load the user’s patience is limited.

Second, practical popular tags

In the website navigation below, if there is a popular label, will undoubtedly make users feel that the site of a professional. Previously using the CMS system, the background of the website provides the input of popular tags. This label is clearly fake, not necessarily really popular. The use of WordPress tag, you can really achieve the popular label. As you increase the number of articles, the label will change. In particular, some do with WordPress CMS site, it seems to have become a standard.

Third, obsolete tags keywords function

Once, when website meta tags (only consider the keywords and description) are essential to SEO. But after the big update of Baidu, which increasingly weakens the role of the key words. We can see the Baidu its products such as Baidu knows, Baidu Encyclopedia, etc., almost can not see the keyword settings, suggesting that identification of the key words for the search engines is an optional extra. While the search engine out to determine the key to the page that can be done from the analysis of the content of the page itself. in fact WordPress itself does not actually set the keyword. Using labels to do keyword is not necessary.

Fourth, using tags to enhance the user experience

Obviously, WordPress users will wonder, then how do I use the label in the end? I want to say is to use labels to enhancing the user experience of the site. We have a guidance, a website has its main keywords, assuming that there are three main keywords in our website, then derived from the three keywords may have hundreds of long tail keywords. The publish articles or product should use these long tail keywords and use labels to organize these keywords, the right location on our website that directs the user to access, then users quickly find the information they need. I think this is the role of the label. At least that way, your users will not get lost in your site.

Fifth, the advanced use of labels

Tags are used to organize Web content, how to organize content? that requires a certain amount of skill. I went through several examples below illustrate.

Example 1: use tags to set up navigation.

Background assumptions: there is a Web site, Chinese poetry, this involves, author of the dynasty, some will require doing lettering. Although we can do with the classification of the dynasty, but the authors can’t do with classification, because it is too much. And only 26 letters can be made into categories, this category too big. So these are not good solution for classification, then how?

Solution is as follows:

Now we enter a Li Bai’s “look Lushan Waterfall,” this poem, we can enter this label: W, Tang, Li Bai, seven words. Then add the following code to the funtion.php file:

 1 add_action('admin_menu', array('DJpluginsOptions', 'add'));
 2 
 3 function get_tag_link_by_slug($tag_slug) {
 4
 5 $tag=get_term_by( 'slug', $tag_slug, 'post_tag' );
 6
 7 if ($tag) return get_tag_link($tag->term_id);
 8
 9 return 0;
10 
11 }

The function of this function is to obtain the label of the link, then you can do in the template the following references:

1 <a href="[?php echo get_tag_link_by_slug('标签名'); ?>">标签名</a>

At this point, we can make the navigation we need.

Example 2: Label the project.

Background assumptions: We now have to do a product class enterprise website, for a product, related to price, size, color, material, details and other information. Although these can be added to the editor, but the problem is that these information can not be put forward alone. Therefore, we can only need another way, such as the details on the editor, while the other on the label. These tags need to design multiple input boxes to facilitate the call.

The solution is as follows:

Add some code to the funtion.php file:

 1 function create_my_taxonomies() {
 2
 3 register_taxonomy('price', 'post', array(
 4
 5 'hierarchical' => false, 'label' => '价格',
 6
 7 'query_var' => true, 'rewrite' => true));
 8
 9 }
10 
11 add_action('init', 'create_my_taxonomies', 0);}

Here only “price”, for example, other analogy. Add the above code, WordPress background there will be “price” input box, release the product only in the “price” input box to enter the price. And then the appropriate location in the template input code can be achieved we need to function:

1 <?php echo get_the_term_list($post->ID, '价格', '价格: ', ', ', '');
  ?>

Label use far more than that, I just played a valuable role. More advanced usage remains to be discovered. And hope that users share the spirit of sharing it out.

This article is the original article, the author blog gold point network www.dianjin123.com, welcome to reprint, but please keep the link, thank you!

 

 

WordPress tips: Do not use .htaccess widget start page Gzip compression

Without the use of plug-in .htaccess start page Gzip compression by Enabling Compression Apache to achieve.

The following http://www.163zuowen.com/ this site, for example the actual operation.

1. First we measured about 163 composition network is enabled gzip compression

Here are a few to test whether the site URL Enable gzip compression:

http://tool.chinaz.com/Gzips/Default.aspx

http://gzip.zzbaike.com/

http://www.websiteoptimization.com/services/analyze/

As shown no gzip compression test:

2、Through FTP to download your. Htaccess file back, open with DW

3、Include the following syntax in the .htaccess file, then save the upload overwrites.

 

 1 <IfModule mod_deflate.c>
 2 # Insert filters
 3 AddOutputFilterByType DEFLATE text/plain
 4 AddOutputFilterByType DEFLATE text/html
 5 AddOutputFilterByType DEFLATE text/xml
 6 AddOutputFilterByType DEFLATE text/css
 7 AddOutputFilterByType DEFLATE application/xml
 8 AddOutputFilterByType DEFLATE application/xhtml+xml
 9 AddOutputFilterByType DEFLATE application/rss+xml
10 AddOutputFilterByType DEFLATE application/javascript
11 AddOutputFilterByType DEFLATE application/x-javascript
12 AddOutputFilterByType DEFLATE application/x-httpd-php
13 AddOutputFilterByType DEFLATE application/x-httpd-fastphp
14 AddOutputFilterByType DEFLATE image/svg+xml
15 # Drop problematic browsers
16 BrowserMatch ^Mozilla/4 gzip-only-text/html
17 BrowserMatch ^Mozilla/4\.0[678] no-gzip
18 BrowserMatch \bMSI[E]!no-gzip !gzip-only-text/html
19 # Make sure proxies don't deliver the wrong content
20 Header append Vary User-Agent env=!dont-vary
21 </IfModule>

We have to test, to see compression 82.67%

 

Optimize your WordPress database on a regular basis to speed up your blog

Today to see their own phpMyAdmin database and found that even 3.5MB database size, it is surprised to see carefully, found wp_comments accounted for 2.2MB. But open the table view, which will be dozens of comments Yeah, think of the latest light spam There are almost more than 10,000 articles, fragments should also be left in the database. It seems that the database must be optimized regularly.

Here are two ways to optimize:

First, open the WordPress phpMyAdmin where the database, the size of the back of the show on the extra data, click on the table below selected items – optimization table, you can clean up the excess data clean.

Second, it is also a fool than the above approach is to use Optimize Database plug-in.

  1. The official download Optimize Database.
  2. Uploaded to / wp-content / plugins /, the return to the console activated.
  3. The console tool options, will add a Optimize Database option, open, you can clearly see how much their own database needs to clean up the data, a key can clean up.
  4. We can usually do not have time to close the plug-in, when used again, so you can avoid too many plug-ins resulting in slow WordPress speed.

No plug-ins to achieve the WordPress home page call article thumbnails

Like tossing modify WordPress theme of friends, must have encountered such a problem, want to display thumbnails in the home page, plug-ins can be achieved, but not easy to operate and control, after all, the code is written by others, I love WP share Plug-in, pure code is how to achieve Home article thumbnail, the method is very simple, even if you do not understand the code, according to the steps is also possible. Of course, the thumbnail select the article is the first picture, if the article does not contain pictures, display the default picture, so you want to top a default picture position.

Step into the topic, start adding the home thumbnail, simple 3-step can be achieved:

Step 1: Locate the functions.php file for the theme template to use Add the following code between <? Php and?>:

 1 function thumb_img($soContent){
 2 $soImages = '~<img [^\>]*\ />~';
 3 preg_match_all( $soImages, $soContent, $thePics );
 4 $allPics = count($thePics[0]);
 5 if( $allPics > 0 ){
 6 echo "<span id='thumb'>";
 7 echo $thePics[0][0];
 8 echo '</span>';
 9 }
10 else {
11 echo "<span id='thumb'>";
12 echo "<img src='";
13 echo bloginfo('template_url');
14 echo "/images/thumb.gif'></span>";
15 }
16 }

This is a thumbnail display method that automatically retrieves the first image of the article, and if the current theme /images/thumb.gif is not displayed, you are ready to put the thumb.gif image in place.

Step 2: Find the index.php file that is the first page of the document, find the_content (); or similar code in it before adding the following code:

thumb_img($post-&gt;post_content);

This calls the method just, in fact, the thumbnail has been completed. But you see the effect must be very unexpected, should not control the size of the picture, it will be ugly. Well, the third step

Step 3: Add thumbnail style CSS code:

This is the cloud station to use the thumbnail style, you can make do with the first, and then be modified

1 #thumb{margin:5px 15px 5px 5px;width:145px;height:120px;border:3px 
  solid #eee;float:left;overflow:hidden;}<br />
2 #thumb img{max-height:186px;max-width:186px}

Well, this thumbnail there is a kind of show up. Three steps to get!

Simple implementation of the first line of each paragraph indented WordPress two characters

The first method to achieve the first line of indentation of the WordPress  article is to modify the css file, the following method applies to most of the WordPress theme:

Find the style.css file in the WordPress theme folder you are using, and add the code at the bottom of the style.css file:

.content p{text-indent:2em;}

or:

#content p{text-indent:2em;}

The first paragraph of the code not to try the second paragraph of the code, in fact, only the “.” “#” Only, in fact, know the principle, then almost all WordPress theme can use this method to modify, so that can achieve the station article The first line of the paragraph is indented by two spaces.

This method is the most simple and effective, more simple than the use of plug-ins, the above code 2em 2 is the meaning of two characters, can be freely changed.

 

Top 10 WordPress optimization method to increase Baidu included

I love WP has been more concerned about the optimization of WordPress, but also intentionally or unintentionally, with some methods, but not a summary of today to see an article on the WordPress optimization of the 10 summary, I used most of the following methods, it is reproduced in full text , Hope to help more loving WordPress friends to optimize their blog, reads as follows:

This site uses WordPress blog program set up, which is currently the world’s most used Jianzhan procedures, the current site in the Alexa ranking or Google (Google) can be successfully included, and have a good SEO effect. However, because the WordPress blog program is born for Google (Google) development, so in Google (Google) has a very good inclusion and ranking, but for the domestic Baidu’s included, the effect is extremely poor. Therefore, in addition to want to let the Chinese blog in Google (Google) has a better ranking, it had to look to transfer to the nation’s largest search engine Baidu body.

WordPress blog program because of their own shortcomings, making it not very cold Baidu, included not only less, but the ranking is not high. The purpose of optimization is to allow Baidu to include all the articles, the second is to get a good ranking in Baidu, in these two points, summed up the top 10 WordPress.

1. Disable the All in one seo plug-in

(Google) is very effective, can get a good ranking, but for Baidu is fatal, not only to your blog (Google) is not only for your blog, Included less, and included in the speed is still very slow. Not disabled All in one seo plug-ins, the original meter eighty-eight to several days before the inclusion, but since the disabled, the collection time is shortened to 2 minutes. As for the reasons, it is complex, do not explain here, just disable like.

2. Increase Baidu Ping

Baidu Ping is when you publish a new article, WordPress Baidu site will be issued a notice, so that Baidu faster to include. Baidu’s Ping address is http://ping.baidu.com/ping/RPC2, increase the method is to open the background, in the settings column in the composition, the bottom line has a “update service”, in accordance with the above Increase the method on it.

3. Do a good job of keywords, description

Each page will have a keyword and description, which is to inform the search engine on this article is mainly to write what is an important means of search optimization. After we disable the All in one seo plugin, it is necessary to manually add the web page template keywords and descriptions. Keywords can directly call the article Tag, and the description can also be directly call the article summary. Specific practices here is not listed, you can directly search.

4. Home design into CMS

Baidu’s blog entry is not very good, so we will try to disguise the blog into a CMS site. Baidu judge a website is not the main basis for the blog is to see the home page is not a large number of abstracts, in addition, Baidu will check the intelligent home page there are no other elements of the link, such as picture links, text links, Web page layout and so on. Knowing this, we will have targeted disguise. First of all, to enable WordPress blog program comes with the article thumbnail, and the home page in the list of calls; Second, we should try to enrich the sidebar, in addition to the latest articles and messages, you can call random articles, popular articles, CMS style to enrich the home page.

5. Increase the current location

The so-called current position refers to the article at the top of the page navigation, as long as the user is aware of the location of the article. Some people think that this is tasteless, dispensable, but it is essential for Baidu, because it is Baidu to determine this chapter.. The article is a blog article or website article basis, because all the big sites in the article above the page will have the current location, so Baidu will be judged to all the properties of the site, because the general page will not have the current location item.

6. The article title to be unique

Search engines are more like the original article, so when we write an article to try to develop a unique title, so for Baidu, there is half of the opportunity to determine this article is the original article. Some people think that the title is difficult to formulate, especially for those who learn science students, here to tell you a way to prepare the article, the first not to develop the title, so after the article is finished, see the full text, Keyword, and then the key words together, so the title to be drawn out. Prepared well, put the title to Baidu inside to search to see if there is no the same, if there is a slight change can be.

7. The content should be original

Blog is used to original article, not to reprint the article, since spent great efforts to establish an independent blog, it may wish to spend effort, try to original article. This is not only conducive to search engines, but also to develop a certain readers. We sometimes want to solve a technical problem on the wordpress blog program, search and found 10 articles in nine are the same, for those who want to rush to solve the problem, really despise those Reproduced, a waste of time we find, but we have not solved the problem. Baidu included in the rules which also emphasizes the importance of the originality of the article, so we should try to original article, do not arbitrarily reproduced, even reproduced, in addition to reprinted links attached, but also at the beginning of the article to write about 200 words Of the introductory text, so for Baidu is still it as an original article to deal with.

8. Concise keywords

Because the article is the key word search engine to determine the basis of the article attributes, so many people in order to make the article has a better ranking, the keyword in the article by adding a large number of irrelevant and popular keywords, which Baidu Is fatal. Baidu keywords for the control of the article is very strict, which included in the rules which also stressed the ban on the stack and the article irrelevant keywords. Therefore, when we write keywords in the article, it is best to only 2-3 and articles related to the keywords can be, if the article attributes a single, then only write a keyword.

9. Increase the article within the chain

In the article refers to the link to the article and the vocabulary of some of the words related to the article link to do so to improve the weight of the site has a crucial role, but will also increase the article was searched for more convenient The reader. Search engines like the original article, prefer the reader-oriented, user-friendly behavior, the article is such a practice within the chain. In the long term, it will gradually increase the weight of the article, so that your article in the search engine will be more and more top rankings.

10. Increase the blog outside the chain

Whether the blog or website, outside the chain are very important, if not outside the chain, blog or website in the Internet will become an island, if the chain is more, it will not only guide the search engine spiders crawling your site many times, But also to your site to bring more traffic. If the quality of the outer chain is better, but also greatly increase the weight of your blog, which is why we all like and relatively high weight of the blog or site exchange link reasons. But do not blindly increase outside the chain, go opportunistic to publish a large number of spam links, this will be counterproductive, serious will lead to the search engine block.

More than 10 ways to thank one meter eighty-eight recommendations. The first eight methods are mainly for the blog and the article itself to optimize the latter two methods is mainly to improve the weight of the site in order to blog articles in the search engine to get a better ranking. If you have a better optimization methods, may wish to leave a message below to benefit more bloggers.