Posts

Showing posts from June, 2016

How to add a program to startup

-> Create a shortcut of your program (.exe file) from root directory -> Go to run command -> Write (%appdata%) and run -> Now to to this directory from the (AppData->Roaming) window -> Directory : (Microsoft\Windows\Start Menu\Programs\Startup) -> Cut and Paste your created shortcut file in this directory -> Restart You PC -> Is it Done Successfully ???

CSS3 @keyframes Concept

@keyframes color_change{      from{color:red;}      to{color:blue;} } OR @keyframes color_change{     0%{color:red;}     100%{color:blue;} } This is the process to define a @keyframes now the job is to call the @keyframes in a CLASS or ID. .text{     animation-name : color_change;    // To Call the @keyframes by it's name     animation-iteration-count : 1;        // How many times the process will be reprocess     animation-duration : 1s;                // How long the process will run in a single execution }

WP Customizer API

index.php <img src="<?php echo get_theme_mod('logo_img'); ?>" alt="Logo"> <?php if(true=== get_theme_mod('copyright_visibility')) : ?> <h1>Copyright : <?php echo get_theme_mod('copyright_text'); ?></h1> <?php endif; ?> <h1 class="fruit">Fruit : <?php echo get_theme_mod('select_fruit'); ?></h1> functions.php /* Customizer API*/ function customize_api($custom_val){        //Section Name : general_section  {A New Section Start} $custom_val->add_section('general_section',array( 'title' => 'General Options', 'priority' => 20 )); //For Logo Upload (general_section) $custom_val->add_setting('logo_img',array( 'default' => '', 'transport' => 'refresh' )); $custom_val->add_control( new WP_Customize_Image_Contr

customizer-scripts.js

index.php <h1>Copyright : <?php echo get_theme_mod('copyright_text'); ?></h1> functions.php function customize_api($custom_val){ $custom_val->add_section('general_section',array( 'title' => 'General Options', 'priority' => 20 )); //For Copyright Text $custom_val->add_setting('copyright_text',array( 'default' => 'Copyright Text', 'transport' => 'postMessage' )); $custom_val->add_control('copyright_text',array( 'section' => 'general_section', 'label' => 'Copyright Text', 'type' => 'text' )); } add_action('customize_register','customize_api'); function scripts_for_customizer(){ wp_enqueue_script('customizer-scripts',get_template_directory_uri().'/js/customizer-scripts.js',array('jquery','customize-preview'

WP customize_register for Logo Upload

/* Customizer API*/ functions.php function customize_api($custom_val){ $custom_val->add_section('general_section',array( 'title' => 'General Options', 'priority' => 20 )); $custom_val->add_setting('logo_img',array( 'default' => '', 'transport' => 'refresh' )); $custom_val->add_control( new WP_Customize_Image_Control($custom_val,'logo_img',array( 'section' => 'general_section', 'label' => 'Logo Uploader', 'settings' => 'logo_img' )) ); } add_action('customize_register','customize_api'); index.php <img src="<?php echo get_theme_mod('logo_img'); ?>" alt="Logo">

WP customize_register for Title OR Text

/* Customizer API*/ functions.php function customize_api($custom_val){ $custom_val->add_section('general_section',array( 'title' => 'General Options', 'priority' => 20 )); $custom_val->add_setting('copyright_text',array( 'default' => 'HKC', 'transport' => 'refresh' )); $custom_val->add_control('copyright_text',array( 'section' => 'general_section', 'label' => 'Copyright Text', 'type' => 'text' )); } add_action('customize_register','customize_api'); index.php <h1>Copyright : <?php echo get_theme_mod('copyright_text'); ?></h1>

Ternary Operator PHP

() ? : ; (Condition) ? TRUE : FALSE ;

class two extends one {}

In object oriented php programming concept if I extends class one into class two and make an object named as $second = new two(); then what will happen actually ?? Then I can access all property of class one by using the object "$second->first_string;" cause I've extended all property of class one from class two. Note : One protected and public property is possible to access from other class.

Process to view repository project on live in github

-> Create a repository name as your wish -> Upload all files to the repository from your project folder -> Go to the branches and add a branch name gh-pages for this repository -> Your job has done -> Now go through the link such as http://username.github.io/repositoryname

The process of hosting a site in github with (https://username.github.io) URL

Step by step is written below, -> Create a repository name as username.github.io -> git clone https://github.com/username/username.github.io -> cd username.github.io -> Copy your project files into the username.github.io folder -> git status -> git add --a -> git commit -m "Uploading Files" -> git push -u origin master

Drop-down Menu in WP

functions.php      <?php         function theme_basic_tools(){        register_nav_menu('site-menu','Site Menu');          }         add_action('after_setup_theme','theme_basic_tools');         require_once('navwalker.php');         function default_site_menu(){       echo '<ul class="nav navbar-nav">';       echo '<li><a href="'.esc_url(home_url()).'">Home</a></li>';       echo '</ul>';         }       ?> index.php           <?php                     wp_nav_menu(array(                    'theme_location' => 'site-menu',                     'menu_class' => 'nav navbar-nav',                     'fallback_cb' => 'default_site_menu',                     'walker' => new wp_bootstrap_navwalker()                 ));             ?>

The process to link js files and css files from functions.php

function porject_styles_scripts(){ wp_register_style('bootstrap',esc_url(get_template_directory_uri()).'/css/bootstrap.min.css'); wp_register_style('awesome',esc_url(get_template_directory_uri()).'/font-awesome/css/font-awesome.min.css'); wp_register_style ('animate',esc_url(get_template_directory_uri()).'/css/animate.css'); wp_register_style('style',esc_url(get_template_directory_uri()).'/css/style.css'); wp_register_style('default',esc_url(get_template_directory_uri()).'/color/default.css'); wp_register_script ('bootstrap',esc_url(get_template_directory_uri()).'/js/bootstrap.min.js', array('jquery')); wp_register_script('easing',esc_url(get_template_directory_uri()).'/js/jquery.easing.min.js',array('jquery')); wp_register_script('scroll',esc_url(get_template_directory_uri()).'/js/jquery.scrollTo.js',array('jquery'));