Posts

Showing posts from January, 2017

Create a Child Theme In Wordpress

Image
Step:1 Create a child theme folder Ø First, create a new folder in your themes directory, located at  wp-content/themes . Ø The directory needs a name. It’s best practice to give a child theme the same name as the parent, but with  -child  appended to the end.  For eg. Parent theme is kickstart then put its chield theme as kickstart-child. Step:2 Create a stylesheet: style.css Ø This tells WordPress basic info about the theme, including the fact that it is a child theme with a particular parent. Ø The following information is required: ·  Theme Name –  needs to be unique to your theme ·  Template –   the name of the parent theme directory Step:3 Create a functions.php file Ø Creating a  functions.php  file is optional. It is only needed if you intend to add additional PHP code to your theme. 

Make carousel slider in shopify

1)  In index.liquid file include following code: add css and js files {{ 'slick.css' | asset_url | stylesheet_tag }} {{ 'slick-theme.css' | asset_url | stylesheet_tag }} {{ 'slick.js' | asset_url | script_tag }} add html part of slider <!--slider start--> <div id="slider">  <!-- Wrapper for carousel items --> <div class="home_slider"> <div>           <a href="{{ settings.slide1_url }}" title="{{ settings[alt] | escape }}"> <img src="{{ 'slide1.jpg' | asset_url }}" class="img-responsive" alt="{{shop.name}}" /></a>               </div>             {% for i in (2..10) %}               {% capture show_slide %}slide-{{ i }}-check{% endcapture %}           ...

Encrypt & Decrypt data using AES algorithm

Ø Encryption: function encrypt($action, $string) {     $output = false;  $encrypt_method = "AES-256-CBC";     $secret_key = 'This is my secret key';     $secret_iv = 'This is my secret iv';  // hash     $key = hash('sha256', $secret_key); // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning     $iv = substr(hash('sha256', $secret_iv), 0, 16);     $output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);     $output = base64_encode($output);    return $output; } $plain_txt = "This is my plain text"; echo "Plain Text =" .$plain_txt; $encrypted_txt = encrypt('encrypt', $plain_txt); echo "Encrypted Text =". $encrypted_txt; Ø Decryption: function decrypt($action, $string) {     $output = false; $encrypt_method = "AES-256-CBC"...