Deprecated: TVE\Dashboard\Webhooks\TD_Webhooks_Sender::xml_encode(): Implicitly marking parameter $xml as nullable is deprecated, the explicit nullable type must be used instead in /home/lanche86/public_html/wp-content/plugins/thrive-product-manager/thrive-dashboard/inc/webhooks/class-td-webhooks-sender.php on line 238
Snippets Archives - Milan Ivanovic - lanche86 https://lanche86.com/snippets/ Expert WordPress Solutions Wed, 21 Aug 2019 14:55:26 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.3 Enable Object caching on Test and Live https://lanche86.com/snippets/object-caching-on-test-and-live-on-pantheon/ https://lanche86.com/snippets/object-caching-on-test-and-live-on-pantheon/#respond Wed, 21 Aug 2019 14:55:21 +0000 https://lanche86.com/?p=2026 Enable Redis on your Pantheon installation only to Test and Live environments.

The post Enable Object caching on Test and Live appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/object-caching-on-test-and-live-on-pantheon/feed/ 0
Simple post counter https://lanche86.com/snippets/simple-post-counter/ https://lanche86.com/snippets/simple-post-counter/#respond Tue, 23 Dec 2014 16:51:04 +0000 https://lanche86.com/?p=1228 Someone in our WPSerbia FB Page asked about different styles for first post in the loop, so this is the snippet for that.   <?php if (have_posts()) : $counter = 1; while (have_posts()) : the_post(); if( $counter == 1 ) { ?> /* First post */ <? } elseif( $counter == 2 ) { ?> /* […]

The post Simple post counter appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/simple-post-counter/feed/ 0
Automatically ban “admin” user https://lanche86.com/snippets/how-to-tips/automatically-ban-admin-user/ https://lanche86.com/snippets/how-to-tips/automatically-ban-admin-user/#respond Sat, 13 Dec 2014 10:34:17 +0000 https://lanche86.com/?p=1217 If you are using iThemes Security (and I do recommend using it), make sure you go to Settings and under Brute Force Protection have “Immediately ban a host that attempts to login using the “admin” username.” checked.   PS: And if YOU get locked out on your “admin” account, who knows why is that good, right? :)

The post Automatically ban “admin” user appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/how-to-tips/automatically-ban-admin-user/feed/ 0
How to zip a folder via SSH Terminal https://lanche86.com/snippets/zip-folder-via-ssh-terminal/ https://lanche86.com/snippets/zip-folder-via-ssh-terminal/#respond Fri, 12 Dec 2014 11:00:08 +0000 https://lanche86.com/?p=1204 This is how you can zip a folder via SSH on your Linux server. zip -r filename.zip foldername/  

The post How to zip a folder via SSH Terminal appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/zip-folder-via-ssh-terminal/feed/ 0
Gravity forms, 18 years old verification https://lanche86.com/snippets/gravity-forms-18-years-old-verification/ https://lanche86.com/snippets/gravity-forms-18-years-old-verification/#respond Thu, 03 Jul 2014 12:14:53 +0000 https://lanche86.com/?p=1136 MM-DD-YYYY // this code will run for form 4 only; change 4 to your form ID add_filter('gform_validation_4', 'verify_minimum_age'); function verify_minimum_age($validation_result){ // retrieve the $form $form = $validation_result['form']; // date of birth is submitted in field 7 in the format YYYY-MM-DD // change the 7 here to your field ID $dob = rgpost('input_7'); // this the […]

The post Gravity forms, 18 years old verification appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/gravity-forms-18-years-old-verification/feed/ 0
Twitter Bootstrap Drop-down on hover https://lanche86.com/snippets/wordpress-snippets/twitter-bootstrap-drop-hover/ https://lanche86.com/snippets/wordpress-snippets/twitter-bootstrap-drop-hover/#respond Sat, 19 Apr 2014 13:14:41 +0000 https://lanche86.com/?p=1110 Twitter Boostrap 3, drop-down menu on hover.   .dropdown-menu { .sub-menu { left: 100%; position: absolute; top: 0; visibility: hidden; margin-top: -1px; } li:hover .sub-menu { visibility: visible; } } .dropdown:hover .dropdown-menu { display: block; } .nav-tabs .dropdown-menu, .nav-pills .dropdown-menu, .navbar .dropdown-menu { margin-top: 0; } .navbar { .sub-menu:before { border-bottom: 7px solid transparent; border-left: […]

The post Twitter Bootstrap Drop-down on hover appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/wordpress-snippets/twitter-bootstrap-drop-hover/feed/ 0
BuddyPress autologin on activation https://lanche86.com/snippets/buddypress-autologin-activation/ https://lanche86.com/snippets/buddypress-autologin-activation/#respond Mon, 25 Nov 2013 21:20:52 +0000 https://lanche86.com/?p=1061 add_action( "bp_core_activated_user", "bp_autologin_on_activation", 40, 3 ); function bp_autologin_on_activation( $user_id, $key, $user) { global $bp, $wpdb; //simulate Bp activation /* Check for an uploaded avatar and move that to the correct user folder, just do what bp does */ if ( is_multisite() ) $hashed_key = wp_hash( $key ); else $hashed_key = wp_hash( $user_id ); /* Check […]

The post BuddyPress autologin on activation appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/buddypress-autologin-activation/feed/ 0
You May Also Like, filter snippet https://lanche86.com/snippets/wordpress-snippets/may-also-like-filter-snippet/ https://lanche86.com/snippets/wordpress-snippets/may-also-like-filter-snippet/#respond Sun, 20 Oct 2013 12:13:12 +0000 https://lanche86.com/?p=1037 “You May Also Like”, code snippet for displaying list of posts from the same category on page: add_filter( 'the_content', function() { $id = get_the_id(); if ( !is_singular( 'post' ) ) { return $content; } $terms = get_the_terms( $id, 'category' ); $cats = array(); foreach ($terms as $term) { $cats[] = $term->cat_ID; } $loop = new […]

The post You May Also Like, filter snippet appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/wordpress-snippets/may-also-like-filter-snippet/feed/ 0
Increase the PHP memory limit with MAMP PRO https://lanche86.com/snippets/how-to-tips/increase-php-memory-limit-mamp-pro/ https://lanche86.com/snippets/how-to-tips/increase-php-memory-limit-mamp-pro/#comments Sat, 19 Oct 2013 17:54:41 +0000 https://lanche86.com/?p=1029 With MAMP PRO you can easily increase the PHP memory limit. Therefore you simply have to change some data within the php.ini file. Here is how it works: Start MAMP PRO Stop the server if it’s running Choose Menu -> File -> Edit Template -> PHP5 php.ini (If you want to change the memory limit for PHP5, […]

The post Increase the PHP memory limit with MAMP PRO appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/how-to-tips/increase-php-memory-limit-mamp-pro/feed/ 2
Select And Copy Text Right In Quicklook https://lanche86.com/snippets/select-copy-text-right-quicklook/ https://lanche86.com/snippets/select-copy-text-right-quicklook/#respond Thu, 19 Sep 2013 14:14:26 +0000 https://lanche86.com/?p=1002 First launch Terminal app, and paste or type in the following command: defaults write com.apple.finder QLEnableTextSelection -boolean YES;   Then restart the finder with the following command: killall Finder   Source: http://www.cultofmac.com/216414/select-and-copy-text-right-in-quicklook-os-x-tips/  

The post Select And Copy Text Right In Quicklook appeared first on Milan Ivanovic - lanche86.

]]>
https://lanche86.com/snippets/select-copy-text-right-quicklook/feed/ 0