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”

Seeing Better with Dial Vision Glasses

I need glasses to see up close, but I cannot use bifocals at the computer. They make you have to tilt your head back to see, and that becomes extremely uncomfortable on my neck in a short period of time. I needed glasses that had the entire lens set to see what I was looking at. I want to give Dial Vision Glasses a try. They can be set to your prescription by turning a dial. It is pretty quick. I can go from the adjustment to see at a distance to the adjustment to see small text quickly. Plus, I can look out the entire lens to see the monitor. This makes them much nicer for me than just plain old bifocals. Continue reading “Seeing Better with Dial Vision Glasses”

There is a Medication That Can Make Your Eyelashes Thicker and Longer

Did you even know that hypotrichosis of eyelashes is a thing? It is when the eyelashes do not grow in thick or long. I don’t imagine too many guys worry about it, but us girls certainly do. Well, we do if we have the problem. A medication used to lower intra-ocular pressure for people with glaucoma has also been discovered to grow long and thick eyelashes. The medication is bimatoprost that is combined with synthetic analog of prostamide and sold as Careprost. It causes the growth cycle of the eyelashes to last longer. Hence, you get longer and thicker eyelashes.

Now adding mascara on top of that can help you get the eyelash look you want. Continue reading “There is a Medication That Can Make Your Eyelashes Thicker and Longer”

The Boss Finally Got Caught

Of course it is not like I did not know all about this, or at least the basic facts of the situation. For at least a year, the boss has been fooling around with a brunette half his age or maybe less. She drives up to the office regularly and picks him up. Of course it was only a matter of time before the wife found out, especially since he was doing almost nothing to be discreet about it. I got the call from a divorce lawyer named Eric M. Willie, P.C. to give a disposition, which seems like a really bad idea for me, aside for one fact. The boss is the boss, but only because his wife’s family says that he is. Continue reading “The Boss Finally Got Caught”

A New Place to Live

I cannot take it anymore. My house too much for me to take. It is too crowded. I barely have any space for myself. My family has a lot of members in it, but my home does not have enough room. My personal privacy is disappearing every day. I am in constant danger of people eating my food and hogging my bathroom time. Sometimes. my family members use all of the hot water before I can take a nice shower. I know what I have to do. I am looking at apartments in Hattiesburg. I must move out of my old house and get my own place.

I hate living in my parents house. When I graduated from college, I was very broke. It was hard for me to find a job. The economy was very bad. I was stuck. Continue reading “A New Place to Live”

wordpress removes the wp-json link and the wp-embed.min.js file

Recently updated the latest version of the wordpress 4.4, update what function I do not know, I know I do not have access to, but found that there are several functions inside the link function, I do not have access. So we removed him, mainly more REST API (through the REST API can easily access the site’s data), wp-json link, embeds function (embeds function can allow more convenient reference to third-party resources) wp-embed.min.js file.
We do not have to load it to do what, but also affect the site to read the speed, then we talk about how to prohibit out.
First talk about the disabled REST API, remove the wp-json link method, add the following code to the theme functions.php file to disable the REST API and remove the head inside the output of the link information:

  1. add_filter(‘rest_enabled’, ‘_return_false’);
  2. add_filter(‘rest_jsonp_enabled’, ‘_return_false’);
  3. remove_action( ‘wp_head’, ‘rest_output_link_wp_head’, 10 );
  4. remove_action( ‘wp_head’, ‘wp_oembed_add_discovery_links’, 10 );

Disable embeds is actually more complex (code more), the official and even developed a plug-in for this, we can use the plug-in to disable: Disable Embeds, if you do not want to use plug-ins, then plug the code inside the copy to the theme functions.php File can be.

  1. function disable_emojis() {
  2. remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 );
  3. remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ );
  4. remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ );
  5. remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ );
  6. remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ );
  7. remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ );
  8. remove_filter( ‘wp_mail’, ‘wp_staticize_emoji_for_email’ );
  9. add_filter( ‘tiny_mce_plugins’, ‘disable_emojis_tinymce’ );
  10. }
  11. add_action( ‘init’, ‘disable_emojis’ );
  12. /** 
  13. * Filter function used to remove the tinymce emoji plugin. 
  14. */
  15. function disable_emojis_tinymce( $plugins ) {
  16. if ( is_array$plugins ) ) {
  17. return array_diff$pluginsarray( ‘wpemoji’ ) );
  18. else {
  19. return array();
  20. }
  21. }
  22. function disable_embeds_init() {
  23. global $wp;
  24. $wp->public_query_vars = array_diff$wp->public_query_vars, array( ’embed’, ) );
  25. remove_action( ‘rest_api_init’, ‘wp_oembed_register_route’ );
  26. add_filter( ’embed_oembed_discover’, ‘__return_false’ );
  27. remove_filter( ‘oembed_dataparse’, ‘wp_filter_oembed_result’, 10 );
  28. remove_action( ‘wp_head’, ‘wp_oembed_add_discovery_links’ );
  29. remove_action( ‘wp_head’, ‘wp_oembed_add_host_js’ );
  30. add_filter( ‘tiny_mce_plugins’, ‘disable_embeds_tiny_mce_plugin’ );
  31. add_filter( ‘rewrite_rules_array’, ‘disable_embeds_rewrites’ ); }
  32. add_action( ‘init’, ‘disable_embeds_init’, 9999 );
  33. function disable_embeds_tiny_mce_plugin( $plugins ) { return array_diff$pluginsarray( ‘wpembed’ ) ); }
  34. function disable_embeds_rewrites( $rules ) { foreach ( $rules as $rule => $rewrite ) { if ( false !== strpos$rewrite, ’embed=true’ ) ) { unset( $rules$rule ] ); } }
  35. return $rules; }
  36. function disable_embeds_remove_rewrite_rules() { add_filter( ‘rewrite_rules_array’, ‘disable_embeds_rewrites’ ); flush_rewrite_rules(); }
  37. register_activation_hook( __FILE__, ‘disable_embeds_remove_rewrite_rules’ );
  38. function disable_embeds_flush_rewrite_rules() { remove_filter( ‘rewrite_rules_array’, ‘disable_embeds_rewrites’ ); flush_rewrite_rules(); }
  39. register_deactivation_hook( __FILE__, ‘disable_embeds_flush_rewrite_rules’ );

Every time you update the wordpress version will be more things, such as the previous emoji, and are input on the page content, more or less will affect the speed, our blog is basically updated under the article, engage in too much responsibility for the excessive, Not to get rid of REST API and embeds, for the user experience, so that the website faster display of our code on the OK.

WordPress front end user center often used data and access methods

In the development of ordinary WordPress theme, we have ready-made theme can refer to, but the development of WordPress front-end user center, we are not easy to find a reference, probably because WordPress front-end user center needs no common theme The This article will introduce some of the development of WordPress front-end user center users often to some data acquisition method.

Global variables:

  1. $authordata
  2. $post
  3. $wp_query

Get the author archive page link

  1. echo get_author_posts_url( $authordata->ID );

Get the author’s nickname

  1. echo esc_attr( $authordata ->display_name )

Get the number of comments, use in loop:

  1. echo $post->comment_count

Get comment link, loop use:

  1. comments_link()

Get the current login user information

  1. $current_user = wp_get_current_user();

Gets the user information that needs to be operated

  1. global $wp_query;
  2. $author = $wp_query->get_queried_object();

Above is the development of front-end user center wordpress time often used in some of the data acquisition method, of course, this is only part of which I will be in the development of front-end user center when the accumulation gradually added for your reference.

Code to achieve WordPress automatic keywords keywords and description

The following code to achieve the label as a keyword; to summary for the description, if not fill out the abstract, then automatically intercept the article before the 200 words for the description. (Tutorial transferred from: DeveWork)

Code to achieve WordPress automatic keywords and description:
The following code put under your theme funtions.php the last one?

// Automatic keywords and description
function get_cats_name () {
$ allcats = get_categories ();
foreach ($ allcats as $ category)
{
$ keywords [] = $ category-> cat_name;
}
return $ keywords;
}
// utf8 substr
function utf8Substr ($ str, $ from, $ len) {
return preg_replace (‘# ^ (?: [x00-x7F] | [xC0-xFF] [x80-xBF] +) {0,’. $ from. ‘}’.
(): [x00-x7F] | [xC0-xFF] [x80-xBF] +) {0, ‘. $ len.’}). * # s’
‘$ 1’, $ str);
}
// Meta SEO
function meta_SEO () {
global $ post;
$ output = ”;
if (is_single ()) {// if it is an article page
$ keywords = ”;
$ description = ”;
if ($ post-> post_excerpt) {// If the article abstract exists on the article summary to describe
$ description = $ post-> post_excerpt;
$ description = str_replace (“rn”, “”, $ description);
$ description = str_replace (“n”, “”, $ description);
$ description = str_replace (“” “,” ‘”, $ description);
$ description. = ‘…’;
} else {// If the article summary does not exist, truncate the article before the 200 words for the description
$ description = utf8Substr (strip_tags ($ post-> post_content), 0,200);
$ description = str_replace (“rn”, “”, $ description);
$ description = str_replace (“n”, “”, $ description);
$ description = str_replace (“” “,” ‘”, $ description);
$ description. = ‘…’;
}
$ tags = wp_get_post_tags ($ post-> ID); // take the article tag
foreach ($ tags as $ tag) {
$ keywordarray [] = $ tag-> name;
}
// Use the article tag as a keyword
$ keywords = implode (‘,’, array_unique ((array) $ keywordarray));
} else {// if it is not an article page
$press = ‘wordpress, wordpress theme, wordpress tutorial, wordpress theme download, wordpress blog theme, wordpress corporate theme, wordpress theme custom’; // quotation marks between your blog keywords,
$ description = ‘theme cat, dedicated to the majority of users to provide the latest and most complete wordpress theme’; / / quotation marks between your blog to write a simple description, do not over 200 words
}
// Output keywords
$ output. = ‘<meta name = “keywords” content = “‘. $ keywords. ‘” />’.
$ output. = ‘<meta name = “description” content = “‘. $ description. ‘” />’.
// output description
echo “$ outputn”;
}
add_action (‘wp_head’, ‘meta_SEO’); // add the meta_SEO function to the header

The contents of lines 43 and 44 need to be modified according to your website.

Prohibit wordpress4.4 + version automatically generates a 768 pixel thumbnail

4.4 version later, wordpress added a responsive picture function, the purpose is to allow the picture to adapt to the phone, tablet and other different screens, you upload the picture will automatically generate a 768 pixel thumbnail, but I do not want this feature, the Thumbnail size is fully adjusted to 0, prohibit wordpress automatically generate thumbnails, upload pictures or will generate a 768 pixel thumbnails.

This problem I find a long time did not find a solution to study the day, finally resolved.
In the document wp-admin \ includes \ schema.php Lane in the following code, you can see is 4.4 new features.

  1. // 4.4.0
  2.     ‘medium_large_size_w’ => 768,
  3.     ‘medium_large_size_h’ => 0,

This is the default option to install wordpress, but there is no place to change in the background, there is no change code, because it has been deposited into the database, so go into the database.
Enter the command to change the value of medium_large_size_w to 0 on the line
SQL commands are as follows:

  1. SELECT * FROM `wp_options` where option_name=’medium_large_size_w’

Prohibit wordpress generation 768 pixel thumbnails can effectively save the site space, especially those pictures of many sites (such as the theme of the cat wordpres theme download station) need to prohibit this thumbnail.

Simple and atmospheric responsive blog theme Dobby

Dobby is a free, open-source, self-adaptive theme that he can access with a friendly experience from any browser. Dobby upholds the characteristics of concentrating on writing and reading. The simple and generous structure of the homepage allows blogs to stand out in a cluttered environment. The Dobby theme has a powerful theme background control platform built in. It can easily set keywords and site descriptions, custom top styles, powerful bottom social components, and beautiful blog subscription features to make your website more distinctive. More pages with styles waiting for you to discover!

Theme features

  • Responsive design, perfect display on computer, tablet and mobile phone
  • Custom header picture
  • Built-in picture carousel
  • Footer socialization gadget
  • Built-in multiple ad bar gadgets
  • Powerful background customization
  • Custom theme color
  • Supports WordPress 3.5+, and supports the latest WordPress 4.9

Get theme

GitHub: https://github.com/Vtrois/Dobby

WordPress site replacement domain name of some of the operating methods

In the group to see a lot of friends asked, wordpress to change the domain name to do so? Background settings – routine changes in the domain name, the station can not open, and this is why? Do this
In fact, wordpress for domain name to the database to operate, first of all, to analyze the domain name for several common situations.

One, for space for domain name
1, if it is the above problem, the package backup the old space ftp all the files, into the old station database phpmyadmin export your site database sql file;
2, will be the backup of the ftp all files uploaded to the new space FTP, the backup of the sql uploaded to the new space in the database phpmyadmin;
3, open the new space ftp site root directory to find wp-config.php file, edit it (php file do not use txt to edit), edit the configuration of the new database connection information;
4, to the new space database phpmyadmin Lane, do sql batch for domain name processing (see the following tutorial two)

Second, only for domain name, no room for change
Open the new space of phpmyadmin (database control panel)
And then select the new database name, click, enter wp_ at the beginning of the table is greater than or equal to 11, and then select the sql in the tab, as shown in Figure:

Then is the order for the order of sql batch processing:

 

  • UPDATE wp_options SET option_value = replace( option_value, ‘http://www.old.com’, ‘http://www.new.com’ ) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
  • UPDATE wp_posts SET post_content = replace( post_content, ‘http://www.old.com’, ‘http://www.new.com’ ) ;
  • UPDATE wp_posts SET guid = replace( guid, ‘http://www.old.com’, ‘http://www.new.com’ ) ;

old on behalf of the old domain name, new on behalf of the new domain name, the above implementation of the statement will be modified to your own, and then click on the implementation can be!
To this step, the basic OK OK. The The Of course, for the way the domain name will encounter a variety of problems, there can be a problem to join our technical group to help Kazakhstan!

 

 

WordPress links are automatically added Noopener Noreferrer

I do not know if there is no need to put the chain in the article, taking into account the problem of SEO will generally give the site an article outside the chain automatically nofollow function, nofollow is an HTML tag attribute value. The meaning of this tag is to tell the search engine “Do not follow the links on this page or do not track this particular link.
Beard recently in the editorial website when the article found outside the chain can not automatically add nofollow attribute, after some research is the new version of the wordpress problem.
WordPress automatically adds the new Noopener Noreferrer attribute (resulting in the nofollow property failure) for all links that require a new window in the most recent version update.
Noopener Noreferrer property is not a new release standard, but v4.7.4 version of the WordPress editor will add the default by default.
This property is mainly used to prevent new windows from opening links when there may be phishing attacks, so as a security content WordPress gives added.
But after the addition of the new tab page will not be able to follow the conventional method to track the source page, which in the attribute field has been able to see: No Refer.
After the upgrade to WordPress v4.7.4 version of the original release of the contents of the new window link does not automatically add Noopener Noreferrer.
But if it is a new article or you modify the contents of the previous release, then the new window link will add Noopener Noreferrer.

Please add this code to the bottom of your wordpress theme at function.php and save and upload it

  1. //WordPress links auto add Noopener Noreferrer
  2. add_filter(‘tiny_mce_before_init’,’tinymce_allow_unsafe_link_target’);
  3. function tinymce_allow_unsafe_link_target( $mceInit ) {
  4. $mceInit[‘allow_unsafe_link_target’]=true;
  5. return $mceInit;
  6. }

Precautions:
Add the newly released content after the link if set to a new window open then the Noopener Noreferrer property will no longer be added automatically.
If the previously published article has been attached to the property even after the addition will not automatically remove, you need to manually edit and then delete the new attribute.
That is, manually edit the article and switch the editor to text mode and then rel = “noopener noreferrer” deleted and then save the update on the line.

WordPress website on the line before you have to complete these five things

In the site of the user exchange group which chat, found that many people always ask a question: the site before the line, what needs to be done? I think this question makes sense. According to past experience to sum up, share the theme of the cat’s friends.
Each site may have its own differences, but there are a lot in common. For the WordPress site, before you go online, you should complete the following five things:

1. prohibit search engine index.
This is because when you just started building the site, it is not suitable for search engine content included. At this time, the site content has not yet been built, some text is only some of the presentation. If the search engine contains the content, it is terrible, because the user to see such a content will have a bad impression on your site. You can in the WordPress management background [settings] -> [read] page settings: shielding search engine index site content. Of course, after everything is ready for the site, do not forget to modify the settings here, allowing the search engine to index the site content.

2. Check the website link.
Make sure that all links within the site are working properly. If the site has a failed link, it will affect the site’s SEO ranking. We have a few days ago to recommend you Broken Link Checker free plug-in, can help you complete this work. (To the bottom of this article)

3. Modify the thumbnail size.
When you change the WordPress theme to the site, it’s important to modify the thumbnail size because the thumbnails of many topics are not the same size.

 

4. Check the contents of the website twice.
Including the sidebar of the site, footer area, and navigation bar. We often leave some text errors, especially when you stare at the same site content text for a week, so please check it carefully.

5. View the website with your phone.
If conditions permit, try to check the appearance of your website with a variety of different mobile phones and Internet devices. Otherwise, if you only have a large screen PC, you can also try to continuously reduce the width of the browser to see the appearance of the site in different sizes.
If you have any special experience, welcome to communicate with us through the message.

How to modify the name of the WordPress default role

WordPress provides five default roles, different roles have different permissions, decide what they can and can not do; for example: whether the right to write or review other people’s articles; whether the right to replace the site theme. However, WordPress does not allow you to directly modify the default role name. However, it is not difficult to do it, the theme cat today will tell you how to modify these default roles.
WordPress default 5 roles are: Admin, Editor, Author, Contributor, Contributor, Subscriber.

Why do I need to customize the role name?
For users who use WordPress to build a personal blog, there is no need to modify these role names, because he generally does not use these. But for the corporate website is necessary.
WordPress after the acquisition of WooCommerce, the use of WordPress to build foreign trade sites and online mall users will be further increased. If you use WordPress to help customers to do an e-commerce site, site visitors (that is, potential customers) will be very strange, why their identity is Subscriber (subscribers)? Therefore, this time must deal with this problem.
To modify the default role of WordPress, you only need to write down the code to copy the functions.php file or the site-specific plugin for the theme you are using:

  1. function wps_change_role_name() {
  2.   global $wp_roles;
  3.   if ( ! isset( $wp_roles ) )
  4.    $wp_roles = new WP_Roles();
  5.   $wp_roles->roles[‘contributor’][‘name’] = ‘Owner’;
  6.   $wp_roles->role_names[‘contributor’] = ‘Owner’;
  7. }
  8. add_action(‘init’, ‘wps_change_role_name’);

The name of the Contributor role is changed to Owner (owner, owner). Here you can also use the Chinese, but must remember to save the file as utf8 no bom format, otherwise the Chinese may be displayed as garbled.
This code comes from Kevin Chard’s website. And then look back at the role of the site, turned into this:

However, it should be noted that this code is only the name of the Contributor role modified, and will not modify the corresponding permissions, nor add a new role, and even the role of slug (abbreviation, alias) will not modify.

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 ‘&lt;style type=&quot;text/css&quot;&gt;
  3.         h1 a { background-image:url(‘.get_bloginfo(‘template_directory’).’/images/custom-login-logo.png) !important; }
  4.     &lt;/style&gt;’;
  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 ‘&lt;style type=&quot;text/css&quot;&gt;
  3.           #header-logo { background-image: url(‘.get_bloginfo(‘template_directory’).’/images/admin_logo.png) !important; }
  4.         &lt;/style&gt;’;
  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-&gt;get_node(‘my-account’);
  3.     $newtitle = str_replace( ‘Howdy,’, ‘Logged in as‘, $my_account-&gt;title );
  4.     $wp_admin_bar-&gt;add_node( array(
  5.         ‘id’ =&gt; ‘my-account’,
  6.         ‘title’ =&gt; $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 &quot;Your own text&quot;;
  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.
    die;
    }

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

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!