Tulip Media

Entrepreneurial thoughts

Category: Wordpress

Wordpress

Migrate a WordPress blog from a multisite network to an individual installation

Sometimes we need to extract a WordPress blog from a multisite network in order to give it a clean, standalone installation. This happens in particular when the blog in question requires too much customization, it no longer fits into your multisite network, or simply because you want to pass it on or sell it to someone.

Specify cookie expiration time (or delete them) from WordPress comments

Below WordPress, THE cookie expiration time stored on the computer of the Internet user who commented your blog is extremely long (approximately a year). There are several reasons why a blogger might want to reduce this timeout, starting with improving performance and the desire to have faster page loading. Indeed, one of the pet peeves of bloggers who use the plugin for example W3 Total Cache is the famous mention “Cookie is rejected”, which causes the no caching of pages. In fact, the site is no longer hidden from Internet users who have commented on articles.
Cookies are used to store information about the commentator, which allows them in particular not to fill in the “nickname”, “email” and “website” fields for each comment. If this option is useful for active commenters, it is much less useful for those who comment rarely, and who find themselves deprived of a cache.
So, for reduce cookie expiration time for commenters, and allow pages to be hidden even for an Internet user who has left a comment on your blog, here is a little hack to add to your sacrosanct functions.php.
[icon style=”chain” color=”red”]functions.php[/icon]
[coded]
add_filter('comment_cookie_lifetime', 'my_comment_cookie_lifetime');
function my_comment_cookie_lifetime($lifetime) {
return 259200;
}
[/coded]
And there you have it, thanks to this little piece of code, you set the cookie expiration time to 259,200 seconds, or 72 hours!
Thanks to Shibashake, where you will find other tips related to W3 Total Cache.
Update :
Since the new EU cookie standards, you are required to have your visitors' permission to store "non-essential" cookies. To avoid pop-ups and other unwanted requests which – let’s face it – are more annoying for the user than the cookie itself, here is a way to delete cookies used to store commentator information:
[coded]
remove_action( 'set_comment_cookies', 'wp_set_comment_cookies' );
[/coded]
Obviously add to your functions.php file. Also useful for optimizing your cache!

How to customize the comment cookie expiration time in WordPress

In WordPress, the default how to cookie expiration time is up to 30,000,000 seconds. That's very long, especially for bloggers who are using cache plugins like W3 Total Cache. In fact, this plugin is not caching pages for visitors who have left comments on your blog, because of cookies, and until the cookie is cleared the plugin informs that cookie is rejected.
If you want to reduce the comment cookie expiration time, you have to play with the comment_cookie_lifetime filter in your functions.php file. You can set the expiration time you want, I thing 259 200 seconds in this example.
[icon style=”chain” color=”red”]functions.php[/icon]
[coded]
add_filter('comment_cookie_lifetime', 'my_comment_cookie_lifetime');
function my_comment_cookie_lifetime($lifetime) {
return 259200;
}
[/coded]
Via

Buddypress

Buddypress: link the miniature avatar to the full-size image

If there is one thing that I am often asked to personalize on a social network built with the CMS Buddypress, that’s good avatar management. Indeed, there is on the one hand the fact that the avatar always links to the page already open, which is in itself useless, and on the other hand its size, which cannot be easily customized for a non- initiated.

Buddypress

PHP function to display total number of members under Buddypress

Here is a small function for Buddypress which helped me greatly and which I wanted to share with you for those who need it: little highlighted in the doc, it allows display the total number of registered users on your network.

Wordpress

WordPress tip: put images in the RSS feed

Here is a very simple code which will allow you to insert your featured image in your RSS feed, so that, when you relay your feed on a social network like Facebook for example, the image can accompany the title and the presentation of your post.

Change WordPress Default Email Address

Here is a little tip which concerns the bloggers who use the WordPress CMS. By default, WordPress uses the email «  » and the name “WordPress” to send some notifications to users. This little piece of code will improve the wp_mail function of WordPress and let you personalize the sender email and name.

 

My latest tweets

New shorts on Blooness 👉 Relaunch libido, in bulk -> Sun, vitamin D, keto-Mediterranean diet, proteins, books, banter, walking, HIIT, and no hypocalorie diet.
https://buff.ly/445PWvc

New shorts on Blooness 👉 Improve your sleep -> expose yourself to light in the morning, limit sunglasses, wet your shirt during sports, drink decaf, eat maximum 3 hours before sleeping, take a digestive walk and take some melaton
https://buff.ly/440weAJ

Load more

Don't miss business advice by email

No spam, just an email when new content is published.

en_USEN