Saturday 11 February 2017

Easy Code for create folder to zip folder in php

<?php
function Zip($source, $destination)
{
    if (!extension_loaded('zip') || !file_exists($source)) {
        return false;
    }

    $zip = new ZipArchive();
    if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
        return false;
    }

Auto hide placeholder text on focus on text field.

 it's so simple to remove placeholder text on focus on text field
        and get it back on blur if no text write inside text field.

        we use two function onfocus and onblur to do this.see below Example:

Friday 10 February 2017

Add your own custom jquery in magento 2

 When using custom jquery then not need add cdn jquery library link.Because by default in magneto 2 added jquery library links.
 
require(['jquery'],function($){
    $(window).load(function() {
       <!----code---->
    });
});



Set pagination codding in wp posts Wordpress

WordPress has the ability to split lists of posts or a single post into multiple pages for "paged" navigation.

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$loop = new WP_Query( array(
'post_type' => 'post_type',
'posts_per_page' => 4,
'orderby'=> 'orderBy_attribute',
'paged'=>$paged
) );


Example:

Thursday 9 February 2017

Very easy way Upload File Using PHP

File uploading using php is very simple, follow this step by step tutorial to upload file


Make a Form First
    <form action="" method="post" enctype="multipart/form-data">
        <input type="file" name="upload_file">
        <input type="submit" name="submit">
    </form>
   

Easy and important git commands - GitHub



Here is a list of some basic Git commands to get you going with Git.

 

Since Git was designed with a big project like Linux in mind, there are a lot of Git commands. However, to use the basics of Git, you’ll only need to know a few terms. They all begin the same way, with the word “git.”


Wednesday 8 February 2017

Combined the tax_query and Meta _query of wordpress

WP_Query is a class defined in wp-includes/query.php that deals with the intricacies of a post's (or page's) request to a WordPress blog.

TAX_Query is Creating a taxonomy generally automatically creates a special query variable.which we can use to retrieve posts based on.

Use both the meta_query and the tax_query