I Have to Get Cataract Surgery

I have been having trouble with my vision for a long time and they kept telling me that it was not time for me to get the surgery until just recently. They started me on all of these eye drops and then they gave me the wrong type. I do not know how or why the pharmacy got it mixed up, but the guy who was giving them to me figured it out. The stuff was called careprost and he asked me if I had glaucoma. I told him that I was getting cataract surgery and they wanted me to do the eye drops before I got it and then after I did, all in a specific fashion. In fact I was wondering why they could not do both eyes in the same trip. I have to get up really early in the morning and then they say that it only takes less than half an hour. Luckily for me this guy caught the mistake and he managed to get me what I needed.

In fact it seems as though these people do this surgery on a virtual assembly line. Continue reading “I Have to Get Cataract Surgery”

No plug-in WordPress15 practical tips (1)

The power of WordPress is that you can use plug-ins to easily extend the functionality of your site. But sometimes, we need to modify or add the function, just a few lines of code can be done. Today, the theme cat will give you 15 very practical WordPress skills, and do not need any WordPress plugin.
In the WordPress official plugin directory, there are about 40,000 free WordPress plugins that can extend WordPress functionality. In addition, there are many can not count the number of charge plugins. Through these plug-ins, basically can meet the needs of the vast majority of the site.
But sometimes we need some of the features, no need to plug the same can be done. Below, we will give you some very useful WordPress skills, tips, tips, no need to install any WordPress plugin.
This article is longer, divided into two release. This article is the first chapter, the next article will be released within a week:

WordPress Code Tuning: Administrator and Manage Background (Console, Dashboard)
1. Modify the Logo (logo) in the WordPress website login interface
First introduce a technique related to website branding: If you plan to modify your website (or your client’s website) login interface in the WordPress Logo, the following code is just right for you. Use it very simply, just copy the following code into the funcitons.php file on your site’s theme, or in a plugin dedicated to your site:

  1. function my_custom_login_logo() {
  2.     echo ‘<style type="text/css">
  3.         h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/custom-login-logo.png) !important; }
  4.     </style>’;
  5. }
  6. add_action(‘login_head’, ‘my_custom_login_logo’);

And then do their own Logo, named custom-login-logo.png, upload to the use of the theme directory within the images folder. This code we introduced, but also introduced how to modify the default Logo corresponding to the URL.

2. Modify the Logo of the WordPress management background (dashboard)
Want a WordPress site to stay closer to your business, feel more cordial? Replace WordPress management background (console, dashboard) in the upper left corner of the default WordPress Logo it. Many plugins can do this, but the following code can also directly achieve this function. Similarly, copy the following code into the theme’s funcitons.php file, or in the theme-specific plugin:

  1. function custom_admin_logo() {
  2.   echo ‘<style type="text/css">
  3.           #header-logo { background-image: url(‘.get_bloginfo(‘template_directory’).’/images/admin_logo.png) !important; }
  4.         </style>’;
  5. }
  6. add_action(‘admin_head’, ‘custom_admin_logo’);

Then, you want to use the WP management background in the logo named admin_logo.png, uploaded to the use of the theme directory within the images folder.

3. Close the WordPress login box prompt function
To ensure the security of the WordPress site, it is important that we have written many articles on how to enhance the security of the site. We introduced this technique, but it is a very simple step, but also very useful. The default emptied, when you want to enter the account information log WordPress background, if you enter the information is wrong, WordPress will tell you the error message: the user name does not exist, or password error. This trick is to turn off such tips to enhance the security of the WordPress site.
To disable WordPress login error message, you need to copy the following code into the theme of the funcitons.php file, or within the site-specific plugin:

  1. function no_wordpress_errors(){
  2.   return ‘GET OFF MY LAWN !! RIGHT NOW !!’;
  3. }
  4. add_filter( ‘login_errors’, ‘no_wordpress_errors’ );

In this way, WordPress no longer outputs valid hints that can reduce the likelihood that the site will be compromised.

4. Keep the WordPress login status longer
If you are using WiFi or other wireless network, or use the public computer when the Internet, log on any one site, we must remember to withdraw in time. However, if you at home or company, use their own computer, after a while will be kicked out by WordPress, need to re-login, then it is also very annoying. At this time, you can try this technique to extend the retention time of WordPress login status. Likewise, copy the code into the funcitons.php file or in a site-specific plugin:

  1. add_filter( ‘auth_cookie_expiration’, ‘stay_logged_in_for_1_year’ );
  2. function stay_logged_in_for_1_year( $expire ) {
  3.   return 31556926; // 1 year in seconds
  4. }

By default, if you select the “Remember Me” option when you log in to WordPress, WordPress will remain logged in for 2 weeks. In the above code, we set it to 1 year.

5. Replace “Hello” with “Login as …” in the WordPress toolbar
If you think WordPress at the top of the menu toolbar, the default “Hello” is not suitable for formal occasions, or you want to change a welcome message, please copy the following code to functions.php file, or on the website dedicated plug-in:

  1. function replace_howdy( $wp_admin_bar ) {
  2.     $my_account=$wp_admin_bar->get_node(‘my-account’);
  3.     $newtitle = str_replace( ‘Howdy,’, ‘Logged in as‘, $my_account->title );
  4.     $wp_admin_bar->add_node( array(
  5.         ‘id’ => ‘my-account’,
  6.         ‘title’ => $newtitle,
  7.     ) );
  8. }
  9. add_filter( ‘admin_bar_menu’, ‘replace_howdy’,25 );

In the third line of the above code, the $ newtitle parameter can set the desired greeting. If you want to use Chinese here, please remember to save the file as UTF8 no BOM format.

6. Modify WordPress to manage the background footer text
Brand promotion is to convey information and consistent. So if you create a website for your customers, what you want to do for yourself makes your customers happy and very important to them. Therefore, in addition to changing the login page and management background of the upper left corner of the Logo, you can also manage the background part of the background to add the customer’s slogan (corporate values, vision, etc.) or other interesting text.
Cool! Place the following code in the funcitons.php file, or within the site-specific plugin:

  1. function remove_footer_admin () {
  2.   echo "Your own text";
  3. }
  4. add_filter(‘admin_footer_text’, ‘remove_footer_admin’);

Now, you can add some here to give people a deep impression on the text, or quote some inspirational, connotation of the text, on the echo that line in the double quotation marks on it


7. Add short code to the gadget (pendant)
Short code (shorcode, also translated as “short code”, “short code”, etc.) super useful, because they only need a pair of square brackets, you can replace the original very long code snippet. By default, WordPress Widget (pendant, gadget) does not support short code, can only speak short code as ordinary word processing. However, you can simply use the following code in the functions.php file for the theme you are using, or within the site-specific plugin, you can use the short code in the gadget:

  1. define(‘widget_text’, ‘do_shortcode’);

In this way, you can use short code in Widgets (gadgets).


How to reset the WordPress database

There are always WordPress novice in the theme of the cat’s QQ user group asked this question: how to clear WordPress website data ah? How to restore the wordpress website to the initial state? The simpler rude solution is to empty the database and reinstall it. But today the theme cat to give you recommend a more simple way.
Even skilled use of WordPrss master, there will be such a demand: for example, sometimes need to test the new wordpress theme or plug-in, to delete all the contents of the wordpress site; or want to empty the site content, re-do a new blog.
Before we encounter this problem, we will delete the existing installation (mainly empty or delete the database, etc.); then re-install WordPress. But this is still a bit cumbersome, especially for users who are not familiar with the operation of the database. Now, the theme cat gives you a wordpress plugin that lets you easily reset the WordPress site.

WordPress Database Reset plugin
WordPress Database Reset, meaning “WordPress database reset”, is a free plug-in from WordPress official plug-in directory, you can restore the WordPress database to the default state. Since the various settings of the WordPress site are stored in the database, this also means that all content of the site will be erased and the site will be restored to the initial installation state.
The wordpress plugin is very easy to use, install and enable the plug-in, in the management of the background sidebar management options, find the “Tools (Tools) -” [database reset (Database Reset)].

Here, you can choose to empty a single table (table), such as delete all comments, delete all pages, etc .; you can also choose to empty all the tables.
Next, enter the plugin generated string, in this case s42Uz, and then click the [Reset Database] button. Then, the plugin will revert to WordPress initial settings and bring you back to the admin background home page.
The plugin will not delete or change your files, such as your uploaded images. It only removes custom options and content, including pages, articles and comments, and so on. However, if you want to reset the important site, in order to prevent mistakes, be sure to do a good job backup.

WordPress development tutorial: the original ecology of the wordpress ajax

Recently small V (site friends) in the development of an adaptive wordpress blog theme, the wordpress theme of a large number of data display and submission are used ajax technology, so small V specially written a tutorial record, to facilitate other wordpress developers do wordpress ajax application development time to do reference. If some small partners do not know what is ajax, please Baidu Baidu ~ ~, gossip is not to say, the tutorial began.
Many developers in the write plug-in like the following way to achieve ajax:

  1. require_once( ‘../../../../wp-config.php’ );

Even the Baidu webmaster platform official development of the wordpress structured data submitted plug-in is also the realization of ajax, which is a very irrational wording, because once the user set the directory is different, the relative path will be invalid. And if you Your plugin is using object-oriented writing, you will not be able to directly use some variables and private methods. The biggest drawback is that will lead to the entire WordPress framework to reload again, seriously affecting the efficiency of the site.
In fact, wordpress in order to facilitate the development of developers with ajax function plug-in theme has been pre-defined ajax method, we only need to use the official reservation method to use just fine. In the development of wordpress ajax you first understand that, whether it is the background or foreground any Ajax requests are in admin-ajax.php deal, send a request to admin-ajax.php, there is a required parameter is $ _REQUEST [‘action’] because admin-ajax.php needs to trigger different hooks depending on whether the user is logged in.

  1. if ( is_user_logged_in() ) {
  2.     /**
  3.      * Fires authenticated AJAX actions for logged-in users.
  4.      *
  5.      * The dynamic portion of the hook name, `$_REQUEST[‘action’]`,
  6.      * refers to the name of the AJAX action callback being fired.
  7.      *
  8.      * @since 2.1.0
  9.      */
  10.     do_action( ‘wp_ajax_’ . $_REQUEST[‘action’] );
  11. else {
  12.     /**
  13.      * Fires non-authenticated AJAX actions for logged-out users.
  14.      *
  15.      * The dynamic portion of the hook name, `$_REQUEST[‘action’]`,
  16.      * refers to the name of the AJAX action callback being fired.
  17.      *
  18.      * @since 2.8.0
  19.      */
  20.     do_action( ‘wp_ajax_nopriv_’ . $_REQUEST[‘action’] );
  21. }

The above code from the wordpress system file admin-ajax.php, from the above code we can see that we want to initiate a request first to know whether this request is initiated in the login state? Different state trigger hook is not the same, the following is a theme in the use of jquery achieve ajax example code:

  1. add_action (‘wp_head’, ‘v7v3AjaxScript’);
    function v7v3AjaxScript () {
    print ‘<script> var v7v3_ajaxurl = “‘. admin_url (‘admin-ajax.php’). ‘”‘. “; </ script> n”;
    print “<script>
    $ (docunment) .ready (function () {
    $ .ajax ({
    url: v7v3_ajaxurl,
    data: {
    action: ‘is_login’
    type: ‘post’,
    cache: false,
    success: function (data) {
    alert (data);
    </ scrip> “;

    add_action (‘wp_ajax_nopriv_is_login’, ‘v7v3_ajax_not_login’);
    add_action (‘wp_ajax_is_login’, ‘v7v3_ajax_is_login’);

    function v7v3_ajax_is_login () {
    global $ current_user;
    get_currentuserinfo ();
    printf (‘Login User Hello:% s!’, $ current_user-> display_name);
    / / Die before the end of the die or exit is very important, we must add.

    function v7v3_ajax_not_login () {
    print ‘Dear Visitors Hello! ‘;
    / / Die before the end of the die or exit is very important, we must add.

In the development of wordpress ajax application is the most important point before the end of the function must be added die or exit, if not add the wordpress framework will be reloaded again.

WordPress editor shortcuts – make writing more convenient

Occasionally seen on DeveWork, so reproduced to the wordpress theme download station. This is the default editor of the shortcut keys, but also very easy to remember, with this, you can more convenient to write.

Bold text: Ctrl + B
Text Italic: Ctrl + I
Text strikethrough: Alt + Shift + D
Underline: Ctrl + U
List of non-serial numbers: Alt + Shift + U
Serial number list: Alt + Shift + O
Quotation: Alt + Shift + Q
Left Alignment: Alt + Shift + L
Center: Alt + Shift + C
Right-aligned: Alt + Shift + R
Align at both ends: Alt + Shift + J
Insert the edit link: Alt + Shift + A
Delete the link: Alt + Shift + S
Insert multimedia: Alt + Shift + M
More tags: Alt + Shift + T
Next tab and post article: Alt + Shift + P
Switch spelling checker status: Alt + Shift + N
Full screen mode: Alt + Shift + G
Show / hide advanced features: Alt + Shift + Z
First level title: Ctrl + 1
Secondary title: Ctrl + 2
Level 3 Title: Ctrl +3
Level 4 Title: Ctrl +4
Level 5 Title: Ctrl +5
Six title: Ctrl +6
Paragraph: Ctrl + 7
Insert Div: Ctrl + 8
Address: Ctrl + 9
Select all: Ctrl + A
Cut: Ctrl + X
Copy: Ctrl + C
Paste: Ctrl + V
Undo: Ctrl + Z
Redo: Ctrl + Y
Insert line: Shift + Enter
HTML and visual mode switch: Alt + Shift + E
Help: Alt + Shift + H
Full-screen mode editor width:
Wider: Alt +
Narrower: Alt –
Default: Alt 0

How to limit the length of WordPress messages

WordPress message function (comment function), can encourage users to discuss the contents of the article to discuss the exchange. However, for some serious sites, the message is too long or too short, and is not conducive to communication. In this article, we will show you how to limit the length of WordPress comment message, both to prevent the message content is too short, but also to prevent the message content is too long.

Why limit the length of WordPress comments?
For some of the sites often discussed around a topic, the contents of the comments will be limited to a certain range, but more conducive to discussion, such as comments limited to more than 20 words, 1000 words or less. If someone commented only to write a word, such as “praise”, in fact, not much of a sense. This situation is more like to take links to spam comments. Likewise, if someone’s comments are over 1000 words, the scope of the discussion is largely beyond the scope of an article if it is not made with a lot of spam links. Therefore, by limiting the length of WordPress messages, you can better improve the discussion atmosphere of such sites.

Method 1: Use plugins to limit WordPress message length using plugins is relatively simple
In the WordPress management background, in the [plug-in] -> [install plug-in] page, search Control Comment Length; and then download and activate Control Comment Length plug-in.
Then, in the [Settings] -> [Control Comment Length] page to configure. This is a German plugin, I do not know, but fortunately the interface also includes English translation. In order to facilitate the understanding, I added the Chinese translation in the following figure.

Need to fill in, including the minimum number of words and the maximum number of words, and the message length beyond the limits of the prompt message. Limit the number of words, you can set according to their own website situation. Where the unit is byte, UTF8 encoding in each Chinese characters accounted for 3 bytes, English letters and numbers accounted for 1 byte; so we recommend that you set to 60 and 3000 respectively. If you only want to limit the maximum number of words, you only need to limit the minimum number of words to 1; Similarly, if you only want to limit the minimum number of words, you only need to set the maximum number of words to a large number (such as 99999) can be.
Prompt information content can be set up their own. The contents of the above are German, you should at least replace the same with your WordPress site front language. The message can contain HTML code, so you can define the contents and format of the output prompt. Note that there are three parameters: {CommentLength}, representing the length of the message; {minimalCommentLength}, the minimum number of bytes; {maximalCommentLength}, the maximum number of bytes.

Method 2: Limit WordPress Message Length by Code
If you do not want to use plug-ins, more willing to use code to solve the problem, this approach is more suitable for you. You only need to copy the following code to your wordpress theme funcitons.php file, or put your site dedicated plug-in, you can.

  1. add_filter( ‘preprocess_comment’, ‘wpb_preprocess_comment’ );
  2. function wpb_preprocess_comment($comment) {
  3.     if ( strlen$comment[‘comment_content’] ) > 3000 ) {
  4.         wp_die(‘Comment is too long. Please keep your comment under 3000 characters.’);
  5.     }
  6. if ( strlen$comment[‘comment_content’] ) < 60 ) {
  7.         wp_die(‘Comment is too short. Please use at least 60 characters.’);
  8.     }
  9.     return $comment;
  10. }

It is important to note that the wp_die () function’s quotation marks are messages that are output when the message limit is exceeded, and you can replace it with Chinese (or your site’s corresponding front language). It is important to note that if you want to output Chinese prompts, please remember to save the functions.php file or the website-specific plug-in file as utf8 no bom format to prevent the output garbled; use notepad ++ free editor or everedit charging editor The There is one, each character accounted for 3 bytes, do not forget to convert Oh!

WordPress program in the win and Linux system under the pseudo static settings

Today, this article I came to tell you about the wordpress program in the win and Linux system under the pseudo-static set method.
The first: win system under the wordpress program pseudo static.
wordpress in the win system under the pseudo-static premise is the need for space system to support pseudo-static settings, and we also know that the general win system supports pseudo-static rules for the httpd.ini format, then we first first create a text document, the following code Copy and paste in the inside (this is what I have so far collected the most perfect win system pseudo-static rules).
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from access through HTTP
# wordpress pseudo static rules
# For tag (Chinese label and label page rules)
RewriteRule /tag/(.*)/page/(d+)$ /index.php?tag=$1&paged=$2
RewriteRule /tag/(.+)$ /index.php?tag=$1
# For category (Chinese classification and classification of the rules)
RewriteRule /category/(.*)/page/(d+)$/index.php?category_name=$1&paged=$2
RewriteRule /category/(.*) /index.php?category_name=$1
# For sitemapxml
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /sitemap.html /sitemap.html [L]
RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (ie theme), admin, etc.
RewriteRule /wp-(.*) / wp- $ 1 [L]
# For normal wordpress content, via index.php
RewriteRule ^ / $ /index.php [L]
RewriteRule / (.*) /index.php/$1 [L]
Copy and paste the above code into the text document, we will save the text as httpd.ini, so that our pseudo-static rules on the well, we only need to upload this file to the space more directory, if in the background → fixed link selection Custom link input / %category%/%post_id%.html or / %post_id%.html click to save on it, which we also need a plug-in support, that is, to remove the category URL in the middle of the category, we only need In the background plug-in → install plug-in that search WP No Category Base, the installation is enabled on it. So we win system under the wordpress program pseudo static to complete.
The second: pseudo-static settings under Linux system
This is very simple, we know that the Linux system itself is the most perfect system using wordpress, its pseudo-static settings are very simple, we only need in the background → fixed link select custom link input /% category% /% post_id% .html or / %post_id%.html click Save on it. Similarly, it is also necessary to cooperate with WP No Category Base plug-in, the following I will support the Linux system. Htaccess pseudo-static rules to write out. The code is as follows:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^ index.php $ – [L]
RewriteCond% {REQUEST_FILENAME}! -f
RewriteCond% {REQUEST_FILENAME}! -d
RewriteRule. /index.php [L]
</ IfModule>
# END WordPress
The above code is the same, we need to create a new text document, and then paste the code into the paste, click Save as. Htaccess file, and then upload this file to the root of the space to complete.
This article is written here, and hope that those who use the wordpress program do not know how to set up a friend how to do some help, if you do not understand what, you can leave a message to me, thank you!

To all the wordpress novice, how to detect download the wordpress theme plugin contains the back door

Recently a lot of small partners have been discussing the site was black and download the free wordpress theme plugin hanging horse topic, then today V to teach you how to identify the wordpress theme plug is left behind the door. First of all, under the wordpress operating environment, I believe that a little bit of common sense of the owners know that wordpress is a run on the php + mysql system built on top of the system, and wordpress theme plug-ins are written as. Php suffix executable file this Is why wordpress’s free theme plugin is easy to stay behind the door problem. Since it is written by php, then we just know that the general use of PHP backdoor procedures can be a certain degree of awareness of the theme plug-in whether there is a backdoor Trojans, the following small V lists some common php backdoor function:
Execute system commands: system, passthru, shell_exec, exec, popen, proc_open (high risk)
Code execution: eval, assert, preg_replace (‘/ $ pattern / e’) (high risk)
File operations: file_get_contents, file_put_contents, fputs, fwrite (high-risk)
String encryption and decryption compression decompression hidden: base64_decode, gzinflate, gzuncompress, gzdecode, str_rot13, base64_decode, gzcompress, chr (suspicious)
wordpress Create backdoor user: wp_create_user, WP_User, set_role (high risk)
If the subject of small V mark the high-risk code can basically determine this theme is very problematic, and basically are to stay back door or do little tricks. If it is found in this article marked suspicious code that should be noted that the code is likely to encrypt the part of the back door. Many small partners certainly do not understand preg_replace (‘/ $ pattern / e’) What is the meaning of this code, the following small V to explain to you, preg_replace function using e modifier after the implementation of the reverse reference replacement will be replaced Of the code as php code to run, so it is also a very common backdoor code. In the detection of the theme plug contains the back door as long as the text search tool or software search theme plug-in php file contains the above keywords, in the search for preg_replace need to manually compare the code to see whether the inclusion of e modifier, if the subject file (5) .chr (3) .chr (58) This kind of code should be careful, and found that the subject file appears a lot of random characters have to be careful are generally encrypted code is likely to hide The back door.
PS: Because the usual beard finishing the theme and plug-ins are more, it is difficult to check all the documents are submitted side. Up to check the next few key files are hanging horse, so please download the theme as much as possible after their own check again.

WordPress change the domain name to pay attention to ten things

WordPress replacement domain name may have been experienced in the old and new domain name replacement process, how to make the loss to a minimum, which focus on SEO owners who is essential. One side of my own experience to talk about WordPress change domain name after the attention of ten things.
First, modify the database configuration file
If you change the domain name on the same host in the same space, this step can be saved. If the database is different, you have to open wp-config.php to properly configure the database to access the new domain.
Second, change the blog’s installation address and blog address
First use phpmyadmin to open your database, and then find the wp-options this data table, find the first record is siteurl this, there are 39 home, the two will be changed to your replacement after the domain name can be The Only to complete this step, you can successfully enter the background, or even if you enter the password, it will automatically jump to the original old domain name.
Third, modify the article all the links within the new domain name
I believe we published in the previous article must be added a lot of the chain, the domain name replaced, the old chain also no meaning. In this case, you should change the old domain name in the article to the new domain name. If the background from the editor of a search that is unrealistic, there is a way, universal phpmyadmin into your database, the implementation of the following statement can be all within the article within the chain of old domain name to the new domain name:
UPDATE wp_posts SET post_content = replace (post_content, ‘http://www.xiaohu520.com’, ‘http://www.ztmao.com’);
Four, to re-visit the search engine site
Because the replacement domain name, all from scratch, so if the search engine to re-submit a new domain name, submitted to the process, we must pay attention to my article mentioned several points of attention. After the submission, it is a long waiting process, do not worry, because the start again, that this waiting process, you only put the energy on the original article.
Fifth, the old domain name 301 redirect to the new domain name
Do not think of the old and new domain names are pointing to the same station, this will cause “domain name bombing.” The result of this will not only give your website more traffic, but the search engine that your cheating, down your weight is small, it is not impossible for your station K is not possible. If you want to retain the old domain name of the users, it would have to make a 301 redirect. 301 redirect to SEO or friendly, there are many specific methods, the specific operation is not in this one one detailed
Six, re-modify the statistical code
This should be a very simple thing, and then to the statistical site to apply for the new domain name statistics, the old domain name statistics can be covered.
7. Re-change the feed subscription address
RSS feed subscription is to maintain a station traffic is an important factor, when your domain name are replaced, how others also subscribe. So you should re-set the subscription address, and try to notify the old domain name has been changed friends. Also modify the RSS feed subscription address at the appropriate location on the home page.
8, inform your friendship link
Before your 301 redirect is still in effect, be sure to inform your link and change the old domain name to the new domain name. If 301 is invalid and your link has not been notified, then your link will be meaningless.
9, check the plug-in is working properly
Although the plug-in settings are part of the domain name has nothing to do, but we all know WordPress function is to rely on plug-ins, so replace the domain name, it is best to check whether a plug-in is working properly. Such as Baidu Sitemap Generator and Google XML Sitemaps two plug-ins, must be disabled and then enabled to work properly.
Ten, to your frequent visits to the blog message for rice
I have dozens of visits, basically every day to see, in the bloggers to comment on the time casually talk about your blog for the domain name. Played a hundredfold multiplication effect.

WordPress 4.0.1 fixes 8 security risks and 23 bugs

WordPress 4.0.1 is now available. This is a critical update for the previous version, and it is strongly recommended to update your site immediately.
Web sites that support automatic background updates will automatically be updated to WordPress 4.0.1 over the next few hours. If you are still using WordPress 3.9.2, 3.8.4 or 3.7.4, you will be updated to 3.9.3, 3.8.5, 3.7.5. (We do not support the old version, so please update to the latest best 4.0.1)
WordPress version 3.9.2 and earlier are subject to a critical cross-site scripting vulnerability that could allow anonymous users to compromise the site. This issue does not affect the 4.0 version, but the 4.0.1 version solves the following eight security issues:
3 cross-site scripting problems that can be used by the contributor or author to destroy the site
A cross-site request forged can be used to trick users into changing passwords
1 question that may result in a denial of service when checking the password
When WordPress sends an HTTP request, additional server-side requests for an attack
A very unlikely hash conflict could have affected the user’s account, which also requires them to have not logged in since 2008 (I wish I was kidding)
WordPress now password reset the link in the message, if the user remembers their password, log in, can modify their email address.
4.0.1 also fixed 4.0 of the 23 bug, and we also made two hardening changes, including a better validation of the excerpt from the upload photos of EXIF ​​data.

WordPress add color tag cloud

Tag cloud is a lot of WordPress theme has a theme element, today about how to add color for your theme tag cloud, including the sidebar call and page calls.

1. Call the tag cloud
We can use the wp_tag_cloud () function to implement the tag cloud call. For example, the following example:

  1. <?php wp_tag_cloud(‘smallest=12&largest=18&unit=px&number=0&orderby=count&order=DESC’);?>

Code Comments:
smallest represents the smallest size of the label
largest represents the largest font size
unit = px indicates that the font uses pixel units
number = 0 means that all labels are displayed, and if it is 40, it means 40
orderby = count means the number of articles associated with the label
order = DESC for descending order (ASC for ascending order, DESC for descending order)
For more information on wp_tag_cloud (), please refer to the WordPress documentation wp tag cloud

2. Add a color function
According to the above parameters, you can already call out the tag cloud and add the following code to the last one of the theme’s functions.php?> In front of the color:

  1. //边栏彩色标签
  2. function colorCloud($text) {
  3.     $text = preg_replace_callback(‘|<a (.+?)>|i’,’colorCloudCallback’, $text);
  4.     return $text;
  5. }
  6. function colorCloudCallback($matches) {
  7.     $text = $matches[1];
  8.     $color = dechex(rand(0,16777215));
  9.     $pattern = ‘/style=(‘|”)(.*)(‘|”)/i’;
  10.     $text = preg_replace($pattern“style=”color:#{$color};$2;””$text);
  11.     return “<a $text>”;
  12. }
  13. add_filter(‘wp_tag_cloud’, ‘colorCloud’, 1);

3. Make the tag cloud page
You can take a look at the theme cat tag cloud page:
1) Copy your theme page.php file at the top of the file Add:

  1. <?php
  2. /*
  3. Template Name: Tags
  4. */
  5. ?>

2) Replace the page.php with the following code:

  1. <?php wp_tag_cloud(‘smallest=12&largest=18&unit=px&number=0&orderby=count&order=DESC’);?>

3) The page generally does not require comment function, remove the following code in page.php:

  1. <?php if (comments_open()) comments_template( , true ); ?>

4) You can also according to their own needs, delete some of the functions in page.php, and finally save the file as page-tags.php, so that a tag cloud template to do a good job.
5) visit the WP background – page – create a new page, the page name to fill their own, just in the page properties, select the tags template can:

4. Call the tag cloud in the sidebar
You can use the following function call, the specific method of modification, on your own toss the theme:

  1. <?php wp_tag_cloud(‘smallest=12&largest=18&unit=px&number=20’);?>

However, the general production of more standardized WordPress theme, support Widget gadget, you can in the WP background – appearance – gadget to see whether to support the tag cloud gadget.
Note: This article just tells you how to implement the color tag cloud and how to call it. But the specific style, it is necessary to rely on your own through the CSS code to achieve.

WordPress template architecture

header.php (website head)
This is a global file (easy IT Note: WordPress generated each page will contain the header.php code), display the page header (header) and navigation menu, also contains the HTML file head code (<head> … </ head>). </ p>
The loop (the page body)
The main content of the site is displayed in the main area of ​​the site through a template file containing the “loop” structure.
sidebar.php (sidebar)
This file controls what sidebar shows. If there are multiple sidebars, you can set in the functions.php file, the sidebar “widgets” content can be set in WordPress management control panel (wp-admin).
footer.php (bottom)
The code that contains the global bottom file and closes the HTML tag (</ html>).
The WordPress theme is made up of a series of files in the template folder (.. / wp-contents / themes / template name /), each of which controls the different parts of the template. No matter which page on the site, some parts of these pages are generally static, controlled by the header, siderbar, and footer files. You can modify these files to see which parts of the site are controlled by which files.
Home page
index.php is used to control how the home page of the site is displayed. The index.php defaults to a query and displays the loop of the latest article and displays a hyperlink at the bottom to view the previous article.
Alternatively, you can set any page you created in wordpress as the home page in wp-admin> settings> read. In other words, you can set a different page (or url) as a regular blog article as a home page to display, and that page or through the index.php template generated.
Posts (posts)
single.php is used to control how the article page is displayed. This file contains queries and displays the current article loop.
If you want to display the sidebar (and other elements you want to display), you can specify it in this file. You can also modify the file to make the article page and other pages are different.
Pages (pages)
page.php controls the display of WordPress Page (page, different and post). You can choose to remove the sidebar or other elements, or add some elements only the page.
WordPress also allows you to create different page templates that are used to display different types of pages. Create a page template is very simple, you just copy page.php, change your favorite name, and then add the following code at the top of the file:
<? php
/ *
Template Name: The name of the page template file you named
/ *
archive.php, category.php, tag.php
You can use the above files to control the display of various archive class pages. If the archive page template is not archived, the archive page will use index.php as a template; however, you can create an archive.php instead of index.php as the template for the archive class page. If you created category.php, this file will replace archives.php as a template for the categories. If you created tag.php, this file will be preferred as a template for the tag page.
The Loop
The loop may be the most powerful part of the wordpress template. It starts from a query (to decide which article or page data to grab) and has an end loop. The loop shows what depends on your needs. You can display the title of the article in the loop, the content of the article, the metadata (author, date, etc.), custom fields and comments, etc. These elements are the output of an article or page. You can also create multiple queries and loops on an article or page; for example, in single.php, you can create a loop to display the contents of a single article and then use another loop to display under the article content The title and thumbnail of the article related to this article.
Article and page query mechanism
Start the cycle
(Repeat this and endwhile between all the contents until all the relevant content of the article are finished)
(Output the title of the article)
(The introduction of the article)
(The main content of the output article)
(The name of the output article)
(The author of the output article)
(The date of the output article)
other tags
(Can be inserted in the cycle of the various templates used in the label)
(Repeated until all queries have been output)
Behind the scenes of other mechanisms
To make the wordpress theme template work, you also need some important files in the background. You can modify these files according to their own needs, to customize the function of the site and how to display.
This file controls how the comments are displayed, and the file contains a loop that queries all the comments for an article. comments.php can be overridden by some plugins, such as Disques, that these plugins can take over the comments of the site.
functions.php allows you to add your own php code to modify the core elements of the wordpress theme. Usually this can be used to add multiple sidebars to their own theme, modify the number of characters in the article (excerpt), or add your own admin panel options to wp-admin.
This is the main template style file for the theme template. At the same time at the top of the file, contains the subject name, the author and your site URL and other related text, so WordPress to know the subject of this information.
In addition to the core features of WordPress, other similar plugins, custom fields and wedgets allow you to customize your website further.
There are a lot of open source developer community developed a lot of plug-ins, you can add them to your website for free, including e-commerce, slideshow (slideshow), cache and social function.
Custom Fields
The custom field is when you create an article and can be entered in the input box below the article content input box. Through the custom domain, you can create your own options or content, and then you can use them in the theme template or display them. It is often used with thumbnails and used to include javascript code (include).
The gadget is a small module for the sidebars. In wp-admin, you can configure the default gadget, you can also add a variety of plug-ins provided by the gadget, or php code. Gadgets typically include content such as search forms, popular article lists, and ad blocks.

WordPress do not use plugin with ajax refresh sidebar random article

A friend sent me to ask me, my sidebar that refresh the effect is how to achieve. Can share
In fact, I intend to share these days, that is, time is not allowed, and now we share under how to use ajax refresh wordpress sidebar random article bars
Click on the blog sidebar “refresh” you can see.
How to achieve?
First make sure your theme is called in the js library, and the following code can be found in the topic file header.php. If you do not have it, please copy and paste it before the label.
<script type = “text / javascript” src = “http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js”> </ script>
1, to determine the scope of the article code id. The blog’s random article html code is roughly as shown below. You can also find similar code in your website template. Each topic calls the same function, the middle of a string of code can be ignored.
<h2 class = “sub”> recommended reading </ h2>
<div id = “postlist1”>
<ul class = “spy”>
<? php $ my_query = new WP_Query (‘orderby = rand & showposts = 5’);?>
<? php while ($ my_query-> have_posts ()): $ my_query-> the_post ();?>
<li> <? php $ screen = get_post_meta ($ post-> ID, ‘screen’, $ single = true);?>
<h2 style = “overflow: hidden;”> <a href=”<?php the_permalink()>> “title =” <? php the_title ();?> “> <? php the_title ();?> < a> </ h2>
</ li>
? php endwhile;?>
</ ul>
</ div>
<a href=”#” id=”another”> refresh </a>
Among them, you also need to add a “refresh” to your immediately article code. That is the following code.
<a href=”#” id=”another”> refresh </a>
Also note that the ID “frontlist1” and the last parcel “refresh” ID “another” in front of the ul tag will be used.
2. Create a page template named Random Post. PS: Do not copy the following code. Where the article call function is copied directly from the sidebar.php in the currently used theme.
<? php
/ *
Template Name: Random Post
* /
<? php $ my_query = new WP_Query (‘orderby = rand & showposts = 5’);?>
<? php while ($ my_query-> have_posts ()): $ my_query-> the_post ();?>
<li> <? php $ screen = get_post_meta ($ post-> ID, ‘screen’, $ single = true);?>
<h2 style = “overflow: hidden;”> <a href=”<?php the_permalink()>> “title =” <? php the_title ();?> “> <? php the_title ();?> < a> </ h2>
</ li>
<? php endwhile;?>
3, create a page using the above template, and publish.
We can click here to view this page of this site / random
4, jQuery
Copy and paste the following code into your subject header.php file before placing it on the label.
Where # polist1 and #another are found in step one, combined with your own theme changes.
<script type = “text / javascript” charset = “utf-8”>
$ (). ready (function () {
$ (“# postlist1”). load (“/ random /? offset =” + offset);
$ (“# another”). click (function () {
offset = offset + 5;
$ (“# postlist1”)
.slideUp ()
.load (“/ random /? offset =” + offset, function () {
$ (this) .slideDown ();
</ script>
5 until all ends, you’re done!

WordPress Integrated Alipay

How to integrate in the WordPress program Alipay is to achieve WordPress e-commerce must break through a bottleneck. WordPress has a lot of e-commerce class plugins, like the more famous WP e-Commerce and so on. But the only drawback of these plug-ins is not enough localized, do not support Alipay. Perhaps because WordPress Alipay integrated business application value is relatively high, few people are willing to share the relevant experience free of charge. There are generally WP master are relatively low-key, busy to make money to go. In the online collection of relevant information I have nothing, in addition to that was reprinted hundreds of times I do not know who wrote the so-called tutorial. Here is not to link, because it is not clear who is already original. First explain: This operation requires you to be familiar with the wordpress template and understand the WordPress custom domain related knowledge, understand a little HTML and CSS. Nonsense does not say, the following is a detailed step.
1, first of all if you want to pay a business contract, and apply for a secured transaction or immediately to the transaction, (I apply for immediate arrival) to apply for a general audit period, but Alipay staff efficiency is still very high.
2, after the application you will get an Alipay security check code (key) and a partner identity (Partner ID). This is the official help (graphic). These two numbers are very important, the following will be used.
3, landing Alipay account business service page download integrated technical documents. Or you can go to Alipay Forum download. (Note: download php + utf8).
4, followed by the parameter configuration, you only need to modify the alipay_config.php this file can be.
// partner ID, 16-bit pure number beginning with 2088
$ partner = “”;
// security check code, 32-bit characters consisting of numbers and letters
$ key = “”;
/ / Signed Alipay account or seller Alipay account
$ seller_email = “”;
/ / Transaction process server to notify the page to use http: // format full path, not allowed to add id = 123 such custom parameters
$ notify_url = “http: //www.yourdomain/alipay/notify_url.php”;
/ / Pay the page after the trip to use http: // format full path, not allowed to add id = 123 such a custom parameter
$ return_url = “http: //www.yourdomain/alipay/return_url.php”;
/ / Site products display address, not allowed to add id = 123 such a custom parameter
$ show_url = “”;
// Name of recipient, eg company name, website name, payee name, etc.
$ mainname = “”;
5, will modify the file upload to your site’s root directory, be careful not to change the original directory structure and file name. Quick payment entry template file (index.php), picture, CSS style folder (images) without upload. These two files can be integrated into your wordpress theme. For example I was at http://www.mydomain.com / alipay
6, in fact, where the Long March has been the first step, and then the treasure will be integrated into your theme in the desired location. Such as a single article page (single.php). Integration of the overall idea is to use WordPress custom domain, the value through the form hidden domain or URL parameters with POST way to pass to the interface, and assigned to the interface form to achieve. Here are three very important parameters: product name, description of goods and commodity prices.
Note: form a name is to pay the official file provided by the official treasure naming, generally do not change. If you have a high level of exception.
7, the following is a specific example of code, I integrated it into a single log file. Of course, your WP theme is best designed to change the door of the product page template, rather than the article page common to a template.
<div class = “alipay”>
<FORM name = alipayment action = / wordpress / alipay / alipayto.php method = post target = “_ blank”>
<INPUT type = “hidden” size = 30 name = aliorder value = “<? Php echo get_post_meta ($ post-> ID,” P_name “, true);?>” Maxlength = “200”
<INPUT type = “hidden” maxLength = 10 size = 30 name = alimoney value = “<? Php echo get_post_meta ($ post-> ID,” P_price “, true);?>”
<input type = “hidden” name = alibody value = “<? php echo get_post_meta ($ post-> ID,” P_description “, true);?>”>
<input type = “hidden” name = “pay_bank” value = “directPay”>
<input type = “submit” class = “btn” value = “buy” />
</ FORM>
</ div>
8, here in fact Alipay function has been used. Add a new article, add the appropriate custom field, and then publish. See if you can buy online already? The next step is to beautify the work, if you are proficient in CSS, proficient in HTML form design, proficient in JQURY, you can make payment more beautiful and more secure.
9, if you still have the energy, you can consider the integration of Alipay into plug-ins, improve the relevant configuration options to achieve WordPress background order query and tracking. This is achievable, WordPress has the potential to create a more than ECSHOP or SHOPEX also want to play online shop, and in the search engine optimization performance will be better than the latter two.

WordPress Recycle Bin feature configuration

WordPress Recycle Bin is a feature introduced by WordPress 2.9.
Starting with WordPress 2.9, we can put any content, comments, attachments into the WordPress Recycle Bin. Into the Recycle Bin, we can restore the contents of the Recycle Bin, you can also completely delete the contents of the Recycle Bin.
On the WordPress Recycle Bin function, in addition to the above description, you need to know the following.
First, customize the WordPress Recycle Bin to delete the time
WordPress Recycle Bin content, the default will be deleted after 30 days, the logic is very simple, otherwise the WordPress Recycle Bin will be more bloated.
Of course, if you think 30 days is too long, we can also customize the content storage time, we need to add the following code to wp-config.php Lane.
define (‘EMPTY_TRASH_DAYS’, num);
num = days. By default, here should be the number of days, according to their own hobbies, set the corresponding number of days. After this expires, the content is automatically deleted.
Second, the WordPress Recycle Bin set to delete function.
But that does not mean that we have to always use this recycle bin function, just like some friends know this feature after the evaluation, WordPress official is more and more “out of business”.
Some people still like to immediately delete the content, do not want to operate again in the Recycle Bin, the implementation method is very simple, just need to:
define (‘EMPTY_TRASH_DAYS’, num);
In the num into 0 can be, then moved to the Recycle Bin will become permanently deleted, will not be put into the Recycle Bin, delete directly.