Tuesday, September 1, 2020

WordPress - Disable Lost your password Link and Page Code

 // Disable Lost your password Link and Page

function remove_lostpassword_text ( $text ) {

         if ($text == 'Lost your password?'){$text = '';}

                return $text;

         }

add_filter( 'gettext', 'remove_lostpassword_text' );


add_action('init','possibly_redirect'); 

function possibly_redirect(){ 

   if (isset( $_GET['action'] )){  

     if ( in_array( $_GET['action'], array('lostpassword', 'retrievepassword') ) ) {

        wp_redirect( '/wp-login.php' ); exit;

     }

  }

}


Thursday, August 9, 2018

Drupal Menu not Saving Due to max_input_vars

Add below line to the php.ini or .user.ini which is located in site root folder, if this file is not available you care create and add this line and upload it to the server.
------------------------------------------
max_input_vars = 2000
------------------------------------------

OR

Add these lines to your .htaccess file:
php_value post_max_size = 20000M
php_value upload_max_filesize = 20000M
php_value max_execution_time = 30000
php_value max_input_time = 60000
php_value memory_limit = 8000M
php_value max_input_vars = 8000
php_value suhosin.post.max_vars = 8000
php_value suhosin.request.max_vars = 8000

Tuesday, June 19, 2018

Drupal special characters showing like & and   etc... in drupal page title. Code for fix

Replace below code in page.tpl:
<?php print html_entity_decode($head_title) ?>
instead of
<?php //print $title; ?>

Wednesday, November 8, 2017

Youtube Video Link directly to particular time


Here is the Youtube Video Link directly to particular time link code.

https://www.youtube.com/watch?v=whGwm0Lky2s&feature=youtu.be&t=14m11s

Thursday, April 20, 2017

How to add drupal block into a node?

<?php
     $block = module_invoke('block_name', 'block_view', 'block_id');
     print render($block['content']);
 ?>

Wednesday, July 13, 2016

Countdown Timer / Days count in Business days code in PHP

<?php
$start = new DateTime(null, new DateTimeZone('America/New_York'));
$end = new DateTime('2017-05-05');
// otherwise the  end date is excluded (bug?)
$end->modify('+1 day');

$interval = $end->diff($start);

// total days
$days = $interval->days;

// create an iterateable period of date (P1D equates to 1 day)
$period = new DatePeriod($start, new DateInterval('P1D'), $end);

// best stored as array, so you can add more than one
//$holidays = array('2012-09-07');

foreach($period as $dt) {
    $curr = $dt->format('D');

    // for the updated question
   // if (in_array($dt->format('Y-m-d'), $holidays)) {
     //  $days--;
   // }

    // substract if Saturday or Sunday
    if ($curr == 'Sat' || $curr == 'Sun') {
        $days--;
    }
}


echo $days; // 4?>

Sunday, March 13, 2016

The Future of Angular - Write Code. Learn Angular.

The  Angular is the most important in future for any web applications, it has more features and easy to implement what you want. In the future the trend of web desing is going off and using the latest platform  like bootstrap and Angular Js. these are most important in present trend.

There are lot of predefined codes are available to just do plug and play. So better to focus on latest frameworks and learn and use them on your works for better quality output.

Here are few website to follow:
http://www.learn-angular.org/
https://thinkster.io/a-better-way-to-learn-angularjs
https://www.codecademy.com/learn/learn-angularjs
http://www.w3schools.com/angular/