Wednesday, 30 December 2015

Wi-Tribe / Qubee Extra GB (Bundle offer)


Wi-Tribe / Qubee Bundle GB Offers (When you cross GB limit)

In Wi-Tribe when you exceed your GB limit , they charge you Rs. 0.10 Per MB (Rs. 102 Per GB)
In Qubee when you exceed your GB limit, they don't charge you extra and internet works on reduced speed. that usage is free but slow.

Wi-tribe and Qubee both giving their bundle GB offer for their customers.

-- Wi-Tribe Rs. 75 = 2GB , Rs. 150 = 5GB.
-- Qubee Rs.100 = 3GB , Rs. 200 = 7GB or Rs. 500 = 18GB

 (Customer will not be charged even if he wont buy bundle in QUBEE as packages are AOL(Always OnLine) means no extra charge on usage even exceed limit, but speed will be reduced)

New features of Laravel 5 PHP framework

Laravel is one of the highly used and appreciated coding frameworks by the PHP developers. Developers prefer Laravel over to other frameworks because of the performance, features, scalability it offers. Here we will discuss some exceptional features of Laravel that makes it the PHP Developer’s first choice.



Laravel 5 was launched in November 2014. As expected, there were lots of functional changes in the Laravel 5. It was backed with 22 new features for developers. The company has upgraded the successful version of Laravel 5 in the February this year. The latest version of Laravel 5.1 is available now. Laravel 5.0.1 has restructured framework architecture in the latest release. The company has prominently simplified the Method injection. New route-caching feature has been added to Artisan. Let’s have a look over some of the most important features of Laravel 5. 
New directory structure 
It is a structural change that you might notice first. Laravel 5.0.1 implements PSR-4 autolading standards. That means all the classes are fully namespaced now. Config, Storage and Database folders are moved one level up from the App folder in the new structure. Everything else within folder works exactly the same as previous version. They have also added an additional resources folder. This new folder contains all language and template files. 
Method injection 
Method Injection has been significantly simplified in the latest version of Laravel. You had to demand Inversion of Control (IoC) container to provide a class instance until Laravel 4.2. But you can declare the type hinted class instance in the controller method's signature now.
<?php 
class UserController extends BaseController { 
public function _construct(UseRepositoryInterface $users){
$this->users = $users;
} 
}
Developers can do the same using Injection methods by injecting class into method like following:
<?php namespace App\Http\Controllers\Auth; 
use Illuminate\Routing\Controller;
use Illuminate\Contracts\Auth\Authenticator; 
use App\http\Requests\Auth\registerRequest; 
class AuthController extends Controller{
public function _constuct(Authenticator $auth)
{
$this->auth = $auth;
}
public function postRegister(RegisterRequest $request)
{
$this->auth->login($user);
return redirect('/');
}          
}
Contracts
Contract is basically a set of interfaces that defines the core services. If you need caching in package, you can achieve that using Illuminate\Contacts\cache. You can do cache programing anywhere in the code using the concrete cache class without changing the package code. All these happen in the Application.php file under Illuminate\Foundation\folder.
Route caching
Route caching feature speeds up the application route registration. This feature is perfectly suitable for you if your application has a large number of routes. You can use PHP artisan route: cache and PHP artisan route:clear commands to turn ON and OFF the route catching in the program. It is generally implemented as a part of deployment process.
Authentication
Authentication is the most important part of any web application and developers spent enormous time writing the authentication code. Authentication has become simpler with this update in Laravel 5. Laravel 5 contains the ready to use inbuilt authentication system. You just need to configure database migrations, models, controllers and views to make the system work.
Events object
Developers were enforced to declare application events as a string until now. But you can declare new events in the application using “event object” using Laravel 5.  You can create event objects using php artisan make:event <event-name> and event header object using php artisan handler:event <handler-name>. You can fire the events using Event::fire(new Event(params)) once you create any new event.
Multiple file system
Laravel 5 provides the native support for multiple file system. Laravel uses third party package Flysystem to provide multiple file support. You can use any of Local or Cloud based storage to provide simple configuration. You can configure storage options in config/filesystems.php file. You can also bypass all file system facade in the application and work directly disk facade.

These are some of the most advance features of Laravel 5. There are some other features as well. For example, Queue and Task Scheduling, Request Object, Laravel Socialite, Commands etc. Laravel 5 has improved a lot from the architectural perspective. It also works seamlessly for code organization and maintenance. You can install laravel 5 from here

Monday, 21 December 2015

Load more posts on click using jQuery

DEMO: https://jsfiddle.net/gmkhussain/hd4603gj/

HTML=========
<h2>Load More Posts</h2>

<div id="allpost">

<div class="post-box" id="hari1">
             <div class="post-img col-sm-3">
                            <img width="155" height="136" src="http://localhost/projects/summer-blog/wp-content/uploads/2015/12/image1-1.jpg" class="attachment-full size-full wp-post-image" alt="image1">                                                        </div>
       <div class="post-content col-sm-9">
            <h3>Fifth Blog Heading Goes Here</h3>
                                 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate…         <!--<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim.</p>
         <p>Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae justo Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum sempjr niig</p>-->
            <span class="date pul-lft">21 December, 2015<!--14 August, 2015--></span>
         <span class="readmore pul-rgt"><a href="http://localhost/projects/summer-blog/2015/12/21/fifth-blog-heading-goes-here/">Read More</a></span>  
       </div>
        </div>
        
        <div class="post-box" id="hari1">
             <div class="post-img col-sm-3">
                            <img width="155" height="136" src="http://localhost/projects/summer-blog/wp-content/uploads/2015/12/image1-1.jpg" class="attachment-full size-full wp-post-image" alt="image1">                                                        </div>
       <div class="post-content col-sm-9">
            <h3>Fifth Blog Heading Goes Here</h3>
                                 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate…         <!--<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim.</p>
         <p>Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae justo Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum sempjr niig</p>-->
            <span class="date pul-lft">21 December, 2015<!--14 August, 2015--></span>
         <span class="readmore pul-rgt"><a href="http://localhost/projects/summer-blog/2015/12/21/fifth-blog-heading-goes-here/">Read More</a></span>  
       </div>
        </div>
        
        <div class="post-box" id="hari1">
             <div class="post-img col-sm-3">
                            <img width="155" height="136" src="http://localhost/projects/summer-blog/wp-content/uploads/2015/12/image1-1.jpg" class="attachment-full size-full wp-post-image" alt="image1">                                                        </div>
       <div class="post-content col-sm-9">
            <h3>Fifth Blog Heading Goes Here</h3>
                                 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate…         <!--<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim.</p>
         <p>Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae justo Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum sempjr niig</p>-->
            <span class="date pul-lft">21 December, 2015<!--14 August, 2015--></span>
         <span class="readmore pul-rgt"><a href="http://localhost/projects/summer-blog/2015/12/21/fifth-blog-heading-goes-here/">Read More</a></span>  
       </div>
        </div>
        
        
        <div class="post-box" id="hari1">
             <div class="post-img col-sm-3">
                            <img width="155" height="136" src="http://localhost/projects/summer-blog/wp-content/uploads/2015/12/image1-1.jpg" class="attachment-full size-full wp-post-image" alt="image1">                                                        </div>
       <div class="post-content col-sm-9">
            <h3>Fifth Blog Heading Goes Here</h3>
                                 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate…         <!--<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim.</p>
         <p>Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae justo Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum sempjr niig</p>-->
            <span class="date pul-lft">21 December, 2015<!--14 August, 2015--></span>
         <span class="readmore pul-rgt"><a href="http://localhost/projects/summer-blog/2015/12/21/fifth-blog-heading-goes-here/">Read More</a></span>  
       </div>
        </div>
        
        
        <div class="post-box" id="hari1">
             <div class="post-img col-sm-3">
                            <img width="155" height="136" src="http://localhost/projects/summer-blog/wp-content/uploads/2015/12/image1-1.jpg" class="attachment-full size-full wp-post-image" alt="image1">                                                        </div>
       <div class="post-content col-sm-9">
            <h3>Fifth Blog Heading Goes Here</h3>
                                 Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate…         <!--<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque natibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec pellentesque eu pretium uis, sem. Nulla consequat massa quis enim.</p>
         <p>Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae justo Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum sempjr niig</p>-->
            <span class="date pul-lft">21 December, 2015<!--14 August, 2015--></span>
         <span class="readmore pul-rgt"><a href="http://localhost/projects/summer-blog/2015/12/21/fifth-blog-heading-goes-here/">Read More</a></span>  
       </div>
        </div>
        
        
        <div class="loadmore">Load More</div>
        

        </div>







CSS======

<style>
.post-box {
    border: 1px solid #39c;
    margin: 0 0 20px;
    padding: 20px;
    display:block;
}
.notvis {background-color:#eee; display:none;}

.post-box:nth-child(1), .post-box:nth-child(2) {
    display: block;
}

.loadmore {
    background-color: #39c;
    color: #fff;
    padding: 20px;
    width: 140px;
    text-align: center;
    border-radius: 30px;
    float: none;
    margin: 0 auto;

}
</style>











JS==========

<script>
$(document).ready(function () {
$(".post-box").addClass("notvis"); 
total = $("#allpost .post-box").size();
x = 2;
//alert("total"+ total);

    $('.loadmore').click(function () {
       //y = x;
        $(total);
        alert(x);
    $(".post-box").removeClass("notvis");     
$(".post-box:gt("+x+")").addClass("notvis"); 
     x = x + 1;
    });
});
</script>

Thursday, 17 December 2015

remove span elements from Contact form 7 but keeping inside elements

//remove span elements from Contact form 7 but keeping inside elements

var cf7input = $( ".wpcf7-form-control" );
  if ( cf7input.parent().is( "span" ) ) {
    cf7input.unwrap();
  } else {
    cf7input.wrap( "<span></span>" );








 



jQuery('.form-group br').remove();


 

//On focus add class for animation (optional)
jQuery('.form-control').focusout(function(){
 var text_value=jQuery(this).val();
     if(text_value!='')
       {

//alert(1);
jQuery(this).addClass("wariya");
        }else{jQuery(this).removeClass("wariya");}
});



DEMO: https://jsfiddle.net/qjw5nr7r/

Wednesday, 16 December 2015

How to display post featured image and content call by Post ID WordPress

<?php $post = get_post(159); setup_postdata($post);?>
<p><?php  the_content();?></p>

<?php the_post_thumbnail(); ?>

how to create and display categories for post type in WordPress

/******services_posttype***********/
function args_ourwork_posttype(){
   $args_services = array(
   'labels'=> array( 'name'=>'ourwork Tab',
       'singular_name'=> 'ourwork',
       'menu_name'=>'ourwork',
       'name_admin_bar'=> 'ourwork',
       'all_items' =>'View all ourwork',
       'add_new'=> 'Add New ourwork' ),
   'description' =>"This post type is for ourwork",
   'public' => true,
   'exclude_from_search'=>false,
   'publicly_queryable'=> true,
   'show_ui' => true,
   'show_in_menu'=> true,
   'show_in_admin_bar'=> true,
   'menu_position'=>6,
   'capability_type'=> 'page',
   'menu_icon' => get_stylesheet_directory_uri().'/images/dash-logos.png',
   'supports'=> array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',
    ),
   'query_var'=>true,
  );

register_post_type( "ourwork", $args_services );
    $categories_labels = array(
        'label' => 'ourwork Category',
        'hierarchical' => true,
        'query_var' => true
    );
    register_taxonomy('ourwork_categories', 'ourwork', $categories_labels);

 }

 add_action("init","args_ourwork_posttype");
/******./args_services_posttype**********/








==========================







<?php

 $args = array(
 'post_type'=> 'ourwork',
 'tax_query' => array(
  array(
   'taxonomy' => 'ourwork_categories',
   'field' => 'slug',
   'terms' => 'all'
  )
 )
);

$my_query = new WP_Query($args);
//$postslist = get_posts( $args_args );
//var_dump($postslist);

//exit;
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post(); ?>
           

<div class="tab-img col-sm-3">
                 <?php the_post_thumbnail('full'); ?>
  <div class="tab-hover text-center">
  <img src="<?php echo get_stylesheet_directory_uri();?>/images/eyehover.png">
  <div class="link-hover"><?php the_content();?></div>
  </div>
</div>

                   <?php
  endwhile;
}
wp_reset_query();  // Restore global post data stomped by the_post().
?>
       

Thursday, 10 December 2015

Automatic Deployment Bitbucket (git) to live site

Hostgator has git and svn preinstalled. This enables us to automate deployment! The end result is when you push a commit to bitbucket, the changes are automatically deployed your site… automatically.
For this tutorial I will assume you have
  1. Bitbucket account
  2. Your git repo already uploaded to Bitbucket
  3. sourcetree git client managing your local git repo
  4. root access to your hostgator
  5. SSH access
My bitbucket account is bruceoutdoors, and I’ll be using a private git repo deploy-test.

Set up SSH in hostgator

After you have logged in to the cpanel, use your legacy file manager and set it to home directory and show hidden files.
Create a new .ssh folder if it has not existed.
Download PuTTy if haven’t got it. NOTE: To paste contents to PuTTy, right click on the terminal. Enter something like:
Hostname: gator1111.hostgator.com:1111
Port: 2222
Click “Open”. Login into hostgator with your username and password
run:
cd .ssh
ssh-keygen
We won’t be using any passphrase, so press enter until the SSH Key is generated. This should generate 2 files:
  • id_rsa – private key
  • id_rsa.pub – public key
Create a new file in your .ssh/ directory and name it authorized_keys.
Copy paste the contents of id_rsa.pub inside.
Configure your site’s repo to use SSH instead of HTTPS
Deploy your git repository to your server.
Edit your .git/config in your site directory, change
url = https://bruceoutdoors@bitbucket.org/bruceoutdoors/deploy-test.git
to
url = ssh://git@bitbucket.org/bruceoutdoors/deploy-test.git

Install the public key on your Bitbucket account

Open a browser and log into Bitbucket.
Choose avatar > Manage Account from the menu bar.
The system displays the Account settings page.
Click SSH keys.
The SSH Keys page displays. It shows a list of any existing keys. Then, below that, a dialog for labeling and entering a new key.
copy the contents of the public key file id_rsa.pub.
Back in your browser, enter a Label for your new key, for example, Default public key.
Paste the copied public key into the SSH Key field.
Click the Add key button.
The system adds the key to your account.
Return to PuTTy and verify your configuration by entering the following command:
ssh -T git@bitbucket.org
It should ask you
The authenticity of host ‘bitbucket.org (111.113.10.161)’ can’t be established.
RSA key fingerprint is 11:8p:5b:f2:6f:14:6q:1t:1r:ec:aa:11:11:14:7c:40.
Are you sure you want to continue connecting (yes/no)?
type yes and press enter:
Warning: Permanently added ‘bitbucket.org,111.113.10.161’ (RSA) to the list of known hosts.
logged in as bruceoutdoors.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This will add a “known_hosts” file in ~/.shh/ in hostgator
This is how your .ssh directory will look like now:

PHP Auto Deploy Script
We will now create a php script that will execute the git pull command without us needing to log into hostgator.
Create a file “git-hook.php” in your site repository with the following contents
1
2
3
4
5
6
<?php
echo "<b>Attempting to pull from git repo...</b> <br>";
exec('git pull'$output);
foreach ($output as $o) {
    echo $o '<br>';
}
If you go to the URL of your site, it should output something like:
Attempting to pull from git repo...
 Already up-to-date.
Now to set up hooks so that every time a commit is pushed, it’s changes are automatically reflected in our site.
POST Hooks
In Bitbucket, in your repository settings, Select Hooks. Add a POST hook and enter the URL of your git-hook.php script. It should look like this when you’re done:

Now every time you push a commit to bitbucket’s repo, it will automatically deploy your changes.

how to display woocommerce recent products on wordpress custom page

<section id="recentProductArea">
 <div class="container">
    <h1>Recently Added</h1>

  <div class="products-area">
        <?php
            $args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 4, 'orderby' =>'date','order' => 'DESC' );
            $loop = new WP_Query( $args );
            while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
                    <div class="product-box col-sm-3">    

      <a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
                            <?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" width="65px" height="115px" />'; ?>
                            <h3><?php the_title(); ?></h3>
                            <span class="price"><?php echo $product->get_price_html(); ?></span>
                        </a>

                        <?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
                    </div>
        <?php endwhile; ?>
        <?php wp_reset_query(); ?>
  </div>
 </div>
</section>

Tuesday, 13 October 2015

Common Mistakes of Web Developers

There seems to be endless choices regarding how to accomplish the same task – to develop a website that works in today’s modern web. Web developers have to choose a web hosting platform and underlying data storage, which tools to write HTML, CSS, and JavaScript in, how design will be implemented, and what potential JavaScript libraries/frameworks to include. Once choices are narrowed down, the online world is filled with articles, forums, and samples that provide tips for making a better web experience. Yet no matter which path is taken, all developers are susceptible to mistakes. Although some mistakes will be related to a specific approach, there are challenges shared among all web developers. So through research, experience, and recent observations, I thought I would share a list I compiled of ten common mistakes I see web developers make – and how to avoid them.
The following list is in no particular order.

1) Writing Old School HTML

Mistake : The early days of the internet had much less options for markup than we do today. However, old habits die hard, and many still write their HTML as if we were still in the 20th century. Examples here are using <table> elements for layout, <span> or <div> elements when other semantic-specific tags would be more appropriate, or using tags that are not supported in current HTML standard such as <center> or <font>, or spacing items on a page with a large number of &nbsp; entities.
Impact : Writing last decade’s HTML can result in over-complicated markup that will behave inconsistently across multiple browsers. And it’s not necessary in more recent modern browsers like Microsoft Edge and even past versions of Internet Explorer (11, 10, 9).
How to avoid : Stop using the <table> element for layout of content, and limit usage for it to displaying tabular data. Get acquainted with the current markup options available such as seen at whatwg.org. Use HTML to describe what the content is, not how it will be displayed. To display your content correctly, use CSS ( http://www.w3.org/Style/CSS/).

2) “It Works in My Browser…”

Mistake : A developer may be fond of a particular browser or really despise one, and might primarily test web pages with that bias in-view. It is also possible that code samples found online may be written without factoring how it would render in other browsers. Also, some browsers have different default values for styles.
Impact : Writing a browser-centric site will likely result in very poor quality when displayed in other browsers.
How to avoid : It would not be practical to test web pages in every browser & version during development. However, having a regular interval of checking how your site will appear in multiple browsers is a good approach. Nowadays free tools to help are readily available regardless of your preferred platform: free VMs, site scanners. Sites such as http://browsershots.org/ or https://www.browserstack.com/show snapshots of how a given page would render over multiple browsers/versions/platforms. Tools such as Visual Studio can also invoke multiple browsers to display a single page you are working on. When designing with CSS, consider “resetting” all the defaults as shown at meyerweb.com.
If your site is using any CSS features created specific for a browser, be cautious as to how you will approach vendor prefixes such as -webkit-, -moz-, or -ms-. For guidance on industry trends in this regard, it would be worth your time to examine the following references:
While the above references explain a movement away from vendor prefixes and why, this site provides practical suggestions on how to work through this today.

3) Bad Form

Mistake : Prompting a user to provide any information (especially when entered into a text field) and assuming the data will be received as intended.
Impact : Many things can (and likely will) go wrong when user entry is trusted. Pages may fail if required data is not provided, or data received is not compatible with an underlying data scheme. Even more serious is the intentional violation of the site’s database, perhaps through Injection attacks (see OWASP: Top 10 2013-A1-Injections).
How to avoid : The first bit of advice here is to make sure it is clear to the user what type of data you are looking for. These days, asking for an address could result in either a business, home, or even email address! In addition to be specific, take advantage of data validation techniques available in today’s HTML as seen at this article. No matter how data is validated on the browser side, be sure it is always validated on the server-side as well. Never allow a concatenated T-SQL statement to use data from user entry without confirmation the each field is the type of data it should be.

4) Bloated Responses

Mistake : The page is filled with many high quality graphics and/or pictures, scaled down with use of img element height and width attributes. Files linked from the page such as CSS and JavaScript are large. The source HTML markup may also be unnecessarily complex and extensive.
Impact: The time to have a page completely render becomes long enough for some users to give up or even impatiently re-request the whole page again. In some cases, errors will occur if page processing is waiting too long.
How to avoid : Don’t adopt the mindset that access to the internet is getting faster and faster – thus allowing for bloated scenarios. Instead, consider everything going back and forth from the browser to your site as a cost. A major offender in page bloat is images. To minimize the cost of images that slow down page loads, try these three tips:
  1. Ask yourself: “Are all my graphics absolutely necessary?” If not, remove unneeded images. You can scan your site here for suggestion on which images to compress.
  2. Minimize the file size of your images with tools such as Shrink O’Matic or RIOT.
  3. Preload images. This will not improve the cost on initial download, but can make other pages on site that use the images load much faster. For tips on this, see this article.
Another way to reduce cost is to minify linked CSS and JavaScript files. There are plenty of tools out there to assist in this endeavor such as Minify CSS and Minify JS.
Before we leave this topic, strive to be current with HTML (see mistake #1) and use good judgment when using <style> or <script> tags in HTML.

5) Creating Code That Should Work

Mistake : Whether it is JavaScript or code running on the server, a developer has tested and confirmed that it works, thereby concluding it should still work once deployed. The code executes without error trapping, because it worked when it was tested by developer.
Impact : Sites without proper error checking may reveal the errors to the end users in an ugly way. Not only can the user experience be dramatically impacted, the type of error message content could provide clues to a hacker as to how to infiltrate a site.
How to avoid : To err is human, so bring that philosophy to coding. With JavaScript, be sure to implement good techniques to prevent errors as well as catch them. Although this article addresses JavaScript coding for Windows Apps, the majority of the topics apply to web development too, and it is full of good tips! Another aid to help create solid code that can hold up well to future changes in code is unit testing (see this Wikipedia article).
Failures in server-side code should be caught without the user seeing any of the nerdy details. Reveal only what is necessary, and be sure to set up friendly error pages for things like HTTP 404s (see this Wikipedia article).

6) Writing Forking Code

Mistake : With the noble notion of supporting all browsers and versions, a developer creates code to respond to each possible scenario. The code becomes a heap of if statements, forking in all sorts of direction.
Impact : As new versions of browsers update, management of code files become bulky and difficult to manage. And as mentioned in #1, it’s increasingly unnecessary.
How to avoid : Implement feature detection in code versus browser/version detection. Feature detection techniques not only dramatically reduce the amount of code, it is much easier to read and manage. Consider using a library such as Modernizr which not only helps with feature detection, it also automatically helps provide fallback support for older browsers not up to speed with HTML5 or CSS3.

7) Designing Unresponsively

Mistake : Site development assumes viewing in the same size monitor as the developer/designer.
Impact : When viewing the site in mobile devices or very large screens, the user experience suffers with either not being able to see important aspects of the page or even preventing navigation to other pages.
How to avoid : Think responsively. Use responsive design ( Wikipedia) or ( A List Apart article) in your sites. Here are some practical tutorials on it including responsive images. A very popular library ready to serve in this area is Bootstrap.

8) Making Meaningless Pages

Mistake : Producing public facing pages with content that might be very useful, but not providing any hints to search engines. Accessibility features are not implemented.
Impact : Pages are not as discoverable through search engines and therefore may receive little or no visits. The page content may be very cryptic to users with impaired vision.
How to avoid : Use SEO (search engine optimizations) and support accessibility in HTML. Regarding SEO, be sure to add tags to provide meaning to a page with keywords and description. A good write up on that is found at About Tech. To enable a better accessibility experience, be determined to provide an alt="your image description" attribute in each of your img or area tags. Of course, there is more to do and further suggestions can be investigated at About Tech. You can also test a public web page at Cynthia Says to see if it is compliant with Section 508.

9) Producing Sites That Are Too Refreshing

Mistake : Creating a site that requires full refreshes of a page for each interaction.
Impact : Similar to bloated pages (see mistake #4), performance of page loading time is affected. The user experience lacks fluidity, and each interaction could cause a brief (or long) resetting of the page.
How to avoid : One quick way to avoid this is by determining if posting back to the server is truly required. For example, client-side script can be used to provide immediate results when there is no dependency for server-side resources. You can also embrace AJAX techniques ( Wikipedia) or go further with a single-page application “SPA” ( Wikipedia) approach. Popular JavaScript libraries/frameworks are available to make adoption of these methods much easier, such as JQuery, KnockoutJS, and AngularJS.

10) Working Too Much

Mistake : A developer spends a long time creating web content. Time might be spent doing repetitive tasks, or simply typing a lot.
Impact: Time for initial web site launch or subsequent updates is too lengthy. Value of the developer diminishes when it appears other developers are doing comparable work in less time and with less effort. Manual labor is prone to mistakes, and troubleshooting mistakes takes even more time.
How to avoid : Explore your options. Consider using new tools or new process techniques for every stage of development. For example, how does your current code editor compare to Sublime Text or Visual Studio? Regardless of what code editor you are using, have you recently dived into its features? Perhaps a small investment of your time perusing the documentation could unveil a new way to do something that could save hours & hours of time later. For example, note how an extension to Visual Studio can increase productivity for web developers as seen in this post.
Don’t miss out on tools available on the web to help! For example, check out the tools at dev.modern.ie to simplify testing (across multiple platforms and devices) and troubleshooting.
You can also help reduce time and mistakes by automating processes. An example of this is using a tool like Grunt that can automate things such as the minifying of files (see mistake #4). Another example is Bower which can help manage libraries/frameworks (see mistake #9).
How about the web server itself? With the help of services such as Microsoft Azure Web Apps, you can quickly create a site for virtually any development scenario that can easily scale with your business!

Summary

By identifying common mistakes, web developers can eliminate much frustration that others have already endured. Not only is it important to acknowledge, but when we understand the impact of a mistake and take measures to avoid it, we can create a development process catered to our preferences – and do so with confidence!

Friday, 21 August 2015

How to change LocalHost URL to something else, on a local system using WAMP / XAMPP server?

Step 1
Go to C:\wamp\bin\apache\Apache2.2.17\conf\
open httpd.conf file and change
#Include conf/extra/httpd-vhosts.conf
to
Include conf/extra/httpd-vhosts.conf
i.e. uncomment the line so that it can includes the virtual hosts file.


Step 2
Go to C:\wamp\bin\apache\Apache2.2.17\conf\extra
and open httpd-vhosts.conf file and add the following code
<VirtualHost myWebsite.local>
    DocumentRoot "C:/wamp/www/myWebsite/"
    ServerName myWebsite.local
    ServerAlias myWebsite.local
    <Directory "C:/wamp/www/myWebsite/">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
change myWebsite.local and C:/wamp/www/myWebsite/ as per your requirements.


Step 3
Open hosts file in C:/Windows/System32/drivers/etc/ and add the following line ( Don't delete anything )
127.0.0.1 myWebsite.local
change myWebsite.local as per your name requirements



Step 4
restart your server. That's it

Monday, 17 August 2015

how to create custom post type in wordpress with or without categories




/******slider in dashboard***********/

function my_custom_sliders_posttype(){



$args = array(

'labels'=> array( 'name'=>'sliders',

'singular_name'=> 'slider',

'menu_name'=>'sliders',

'name_admin_bar'=> 'sliders',

'all_items' =>'View all sliders',

'add_new'=> 'Add New sliders' ),

'description' =>"This post type is for sliders",

'public' => true,

'exclude_from_search'=>false,

'publicly_queryable'=> true,

'show_ui' => true,

'show_in_menu'=> true,

'show_in_admin_bar'=> true,

'menu_position'=>6,

'capability_type'=> 'page',

'supports'=> array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',

 ),

'query_var'=>true,





);



register_post_type( "sliders", $args );

}



add_action("init","my_custom_sliders_posttype");



/********************/






IF NEED sub-categories add this code after
add_action("init","my_custom_sliders_posttype");


/**********categories in custom post type  ***********/
register_post_type('blog', $portfolio_args);
$categories_labels = array(

    'label' => 'blog Category',

    'hierarchical' => true,

    'query_var' => true
);
/*********./categories in custom post type  ***********/

Tuesday, 11 August 2015

How to display custom page title content and thumbnail in WordPress

<?php
              // Start the loop.
while ( have_posts() ) : the_post(); ?>

 <?php echo the_post_thumbnail('full'); ?>

 <h1> <?php echo the_title(); ?>  </h1>

 <p>  <?php echo the_content(); ?>  </p>


<?php endwhile ?>

Basic template for wordpress child theme

HEADER.PHP

<?php
/**
 * The template for displaying the header
 *
 * Displays all of the head element and everything up until the "site-content" div.
 *
 * @package WordPress
 * @subpackage Twenty_Fifteen
 * @since Twenty Fifteen 1.0
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
  <head>
 
 
<meta charset="<?php bloginfo( 'charset' ); ?>">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title> <?php bloginfo('name'); ?> </title>
        <link rel="icon" type="image/png" href="<?php echo get_stylesheet_directory_uri(); ?>/images/favicon.png">
        <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css">
        <link href="<?php echo get_stylesheet_directory_uri(); ?>/css/bootstrap.min.css" rel="stylesheet">
    <title>Home</title>


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="">

<header>

</header>

Wednesday, 5 August 2015

How to make Bootstrap Carousel Dynamic in WordPress

/**********functions.php*********/

/******slider in dashboard***********/
function my_custom_sliders_posttype(){
   $args = array(
   'labels'=> array( 'name'=>'sliders',
       'singular_name'=> 'slider',
       'menu_name'=>'sliders',
       'name_admin_bar'=> 'sliders',
       'all_items' =>'View all sliders',
       'add_new'=> 'Add New sliders' ),
   'description' =>"This post type is for sliders",
   'public' => true,
   'exclude_from_search'=>false,
   'publicly_queryable'=> true,
   'show_ui' => true,
   'show_in_menu'=> true,
   'show_in_admin_bar'=> true,
   'menu_position'=>6,
   'capability_type'=> 'page',
   'supports'=> array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',
    ),
   'query_var'=>true,
  );
  register_post_type( "sliders", $args );
 }
 add_action("init","my_custom_sliders_posttype");
/******./slider in dashboard***********/














<!---------Index.HTML--------->


<div class="wide-box-holder slider">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
  </ol>

  <!-- Wrapper for slides -->
  <!--
    <div class="item active">
      <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/slide1.jpg" alt="...">
      <div class="caro-caps">
<h2>BOND / EXIT CLEAN SPECIALISTS</h2>
        <p>Moving Out? We can save you time and moneyby providing you
with bond cleaning, carpet cleaning and pest control
services at a discounted price</p>
<div class="lnk-btn more-btn"><a href="#">More Details</a></div>
      </div>
    </div>
    -->
   
   
   
<div class="carousel-inner">
               <?php
 $class_active="active";

 $args=array(
      'post_type'=> 'sliders',
      'post_status' => 'publish',
      'posts_per_page' => 3,
 
     );
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post(); ?>
             
                <div class="item <?php echo $class_active ;?>">
                 <?php the_post_thumbnail('full'); ?>

<div class="container">
                 <div class="caro-caps">
                  <h2> <?php the_title(); ?> </h2>
                  <p> <?php the_content();?> </p>
<div class="lnk-btn more-btn"><a href="#">More Details</a></div>
              </div>
            </div>
           
                  </div>
                   <?php

 $class_active="";
  endwhile;
}
wp_reset_query();  // Restore global post data stomped by the_post().
?>
                 
 
                </div>


  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
  </a>
</div>


<div class="container">
<div class="ask-form col-sm-4">
    <h3>Ask free Question</h3>
        <?php echo do_shortcode('[contact-form-7 id="16" title="ask-form"]'); ?>
    </div>
</div>

</div>

How to call widgets for footer links in WordPress

How to call widgets on footer to WordPress

NOTE:  create dynamic menu  from "wp-admin/nav-menus.php?" and call on widget

<!---------------functions.php--------------------->

//FOoter
register_sidebar( array(
'name' => 'Footer Sidebar 1',
'id' => 'footer-sidebar-1',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box ftr-logo col-sm-4 ovrimg-mx">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 2',
'id' => 'footer-sidebar-2',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-3">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 3',
'id' => 'footer-sidebar-3',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-3">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 4',
'id' => 'footer-sidebar-4',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-2">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );



register_sidebar( array(
'name' => 'bottom 1',
'id' => 'cr-1',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="pull-lft">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );


register_sidebar( array(
'name' => 'bottom 2',
'id' => 'cr-2',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="pull-rgt">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );



<!---------------FOOTER.HTML--------------------->
<footer>
<div class="ftr clrlist listview">
<div class="container">
<?php dynamic_sidebar( 'footer-sidebar-1' ); ?> <!--ftr logo-->
<?php dynamic_sidebar( 'footer-sidebar-2' ); ?> <!--links-->
<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
    <?php dynamic_sidebar( 'footer-sidebar-4' ); ?> <!--Address-->

        <div class="clearfix"></div>
       
        <div class="cr">

<?php dynamic_sidebar( 'cr-1' ); ?>
<?php dynamic_sidebar( 'cr-2' ); ?>
<!--         <div class="pull-lft">© 2000 – 2015 XYZ.com. All rights reserved.</div>
        <div class="pull-rgt">Designed and Developed by ABC</div>-->
        </div>
       
       
</div>
</div>


<?php  wp_footer(); ?>
</footer>

  </body>
</html>

Tuesday, 4 August 2015

useful functions for wordpress

//*******woocomerce>>>>>>>>//





/*****cart item and amount*****/


 <div class="cart-icon col-sm-4">
 <?php global $woocommerce; ?>

 <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>">

 <?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?>  <?php echo $woocommerce->cart->get_cart_total(); ?></a>
<a href="<?php echo get_permalink( 67 ) ;?>">  <i class="fa fa-shopping-cart"></i></a>



 </div>


//category post per page (function.php, shows 24 products)//

add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

///////////////////////////////////////












//*******atribute calling*******/

 <span><?php $arr =  $product->get_attributes('pa_500ml'); // field name pa_500ml
  //var_dump( $product->get_attributes('pa_500ml'));
  //echo $arr["300ml"]["name"];
   echo $arr["500ml"]["value"];
   ?><!--500ml  |  25 AED--></span>


/******************************/

//related product numbers (add to function.php)//

// Redefine woocommerce_output_related_products()
function woocommerce_output_related_products() {
woocommerce_related_products(4,2); // Display 4 products in rows of 2
}

///////////////////////////////////












//to gt content of category//
 <?php

   $args = array(
     'posts_per_page' => '4',
    'post_type'      => 'product',
'product_cat' => 'signature-blends',
//'order' => 'ASC',
    'meta_query'     => array(
        'relation' => 'OR',
        array( // Simple products type
           // 'key'           => '_sale_price',
            'value'         => 0,
            'compare'       => '>',
            'type'          => 'numeric'
        ),
        array( // Variable products type
            //'key'           => '_min_variation_sale_price',
            'value'         => 0,
            'compare'       => '>',
            'type'          => 'numeric'
        )
    )
);
?>
<?php
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
           
//////////////////////////////////////////////////////////

















/*****(for login)*******/



 <?php if ( is_user_logged_in() ) { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a>
<?php }
else { ?>
<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a>
<?php } ?>


////////////////////////////////////////////////////////////



//get permalink of cat and id//


 <li><a href="<?php echo get_permalink(188, 'product_id');?>">Geranium</a></li>     (for id)

<a href="<?php echo get_term_link(18, 'product_cat' )?>">View More <i class="fa fa-angle-right"></i></a> (for cat)
/////////////////////////////////////



//////////////////////////////////********************///////////////////////////////




/**********/

  <?php
if (is_category()) {
$yourcat = get_category ($cat);
echo ''.$yourcat->slug;
}
?>


/***********************/

















/***show categroy name in singel.php page********/

<?php if(is_single()) {
$category = get_the_category();
$title = $category[0]->cat_name;
echo $title; } ?> ">

//////////////


/******select category & give condition*******/

  <?php

   
if( is_category(array ( "Fall 2008" , "womenswear-1" , "womenswear-2" , "womenswear-3" , "womenswear-4" , "womenswear-5" , "menswear"))){
   
  ?>
       <a href="<?php echo get_permalink( 1033 );?>"><p>2010-2014 <br/>

        <?php
if (is_category()) {
$yourcat = get_category ($cat);
echo ''.$yourcat->slug;
}
?>  <br/>

      Earlier references</p></a>
     
     
     
     
     
       <?php } else{?>
     
     
     
     
     
       <a href="<?php echo get_permalink( 9 );?>"><p>2010-2014 <br/>

         <?php
if (is_category()) {
$yourcat = get_category ($cat);
echo ''.$yourcat->slug;
}
?>  <br/>

      Earlier references</p></a>
     
     
     
     
     
     


<?php }?>



/****************/




















/******date function*********/

<?php echo get_the_date('j F, Y');?>

<?php relative_post_the_date(); ?> (with relative tym 45 minutes ago)


/*********************/


/***** for words limit*********/

<?php echo wp_trim_words( get_the_content(), 50 );?>

/***********/


/***** else in thumbnail*********/

 <?php  if ( has_post_thumbnail() ) {
the_post_thumbnail();
}
else {
echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/logo-south.png" />';
}
?>

/***********/













/****google map iframe***/


 <iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.it/maps?q=<?php echo $address; ?>&output=embed"></iframe>



/************************/


///////call for image zoom(magic zoom plugin)/////////

  <?php $post_thumbnail_id = get_post_thumbnail_id();
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
?>            

                    <a class="MagicZoom"  href="<?=$post_thumbnail_url?>"> <?php the_post_thumbnail('full');?> </a>


////////////////////////////////////////////////




/*****blog on dashboard ******/
<?php
add_action( 'init', 'blog' );
function blog() {
    register_post_type( 'blog',
        array(
            'labels' => array(
                'name' => 'blog',
                'singular_name' => 'blog',
                'add_new' => 'Add New Blog',
                'add_new_item' => 'blog',
                'edit' => 'Edit',
                'edit_item' => 'Edit',
                'new_item' => 'New',
                'view' => 'View',
                'view_item' => 'View',
                'search_items' => 'Search ',
                'not_found' => 'No Adress found',
                'not_found_in_trash' => 'No address found in Trash',
                'parent' => 'Parent news'
            ),

            'public' => true,
            'menu_position' => 4,
            'supports' => array( 'title','editor','thumbnail','comments','custom-fields' ),
            'taxonomies' => array( '' ),
            'menu_icon' =>  get_template_directory_uri().'/images/blog.jpg',
            'has_archive' => true
        )
    );
}
?>

/********************/



/******slider in dashboard***********/

function my_custom_sliders_posttype(){



$args = array(

'labels'=> array( 'name'=>'sliders',

'singular_name'=> 'slider',

'menu_name'=>'sliders',

'name_admin_bar'=> 'sliders',

'all_items' =>'View all sliders',

'add_new'=> 'Add New sliders' ),

'description' =>"This post type is for sliders",

'public' => true,

'exclude_from_search'=>false,

'publicly_queryable'=> true,

'show_ui' => true,

'show_in_menu'=> true,

'show_in_admin_bar'=> true,

'menu_position'=>6,

'capability_type'=> 'page',

'supports'=> array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',

),

'query_var'=>true,





);



register_post_type( "sliders", $args );

}



add_action("init","my_custom_sliders_posttype");



/********************/












/****show data in popup*****/

<div class="container">
<div class="top-btn text-center">
       <a type="submit" class="btn btn-default  signup-btn"  data-toggle="modal" data-target="#quote_box" >SIGN UP NOW</a>
</div>
       
       
        <!-- Modal -->
<div class="modal fade" id="quote_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel"> </h4>
      </div>
      <div class="modal-body">







<div id="mc_embed_signup">
<form action="//autisminsideout.us9.list-manage.com/subscribe/post?u=3551e64937cfa8f02dc58f30b&amp;id=78a2d29258" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
 <h2>I want to know more about Autism Inside Out</h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
 <label for="mce-EMAIL">Email Address  <span class="asterisk">*</span>
</label>
 <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
 <label for="mce-FNAME">First Name </label>
 <input type="text" value="" name="FNAME" class="" id="mce-FNAME">
</div>
<div class="mc-field-group">
 <label for="mce-LNAME">Last Name </label>
 <input type="text" value="" name="LNAME" class="" id="mce-LNAME">
</div>
 <div id="mce-responses" class="clear">
  <div class="response" id="mce-error-response" style="display:none"></div>
  <div class="response" id="mce-success-response" style="display:none"></div>
 </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;"><input type="text" name="b_3551e64937cfa8f02dc58f30b_78a2d29258" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function(cash) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup-->



      </div>
    </div>
  </div>
</div>


/**************************/











/****showing comment count***/

<?php  echo get_comments_number()." Comment" ;?>

/###????///////



/********widget create code **********/

register_sidebar( array(
  'name'          => __( 'footer Links', 'twentythirteen' ),
  'id'            => 'sidebar-4',
  'description'   => __( 'appair in footer' ),
  'before_widget' => '',
  'after_widget'  => '',
  'before_title'  => '',
  'after_title'   => '',
 ) );


/*****widge calling code*****/

<?php
     if ( is_active_sidebar( 'sidebar-4'  ) ) :
dynamic_sidebar( 'sidebar-4' );
endif
     ?>

/***********************/



   
     /******menu code******/\
 
      <?php

$defaults = array(
'theme_location'  => '',
'menu'            => '',
'container'       => 'div',
'container_class' => '',
'container_id'    => 'bs-example-navbar-collapse-1',
'menu_class'      => 'nav navbar-nav',
'menu_id'         => '',
'echo'            => true,
'fallback_cb'     => 'wp_page_menu',
'before'          => '',
'after'           => '',
'link_before'     => '',
'link_after'      => '',
'items_wrap'      => '<ul id="%1$s" class=" nav navbar-nav ">%3$s</ul>',
'depth'           => 0,
'walker'          => ''
);

wp_nav_menu( $defaults );

?>

/***************/







/******search code*****/

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"  >
   <input type="text" id="search" class="form-control"   value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" placeholder="Search" />
   <input class="btn btn-default" type="submit" id="searchsubmit" value="Submit"  />
   </form>
 
   /************/
 









 
   /***** remove version from ctrl+u ********/
 
   remove_action( 'wp_head', 'wp_generator' ) ;
  remove_action( 'wp_head', 'wlwmanifest_link' ) ;
  remove_action( 'wp_head', 'rsd_link' ) ;
 
 
   /****************/
 
   /****page calling code*******/
 
   <?php
    $query = new WP_Query( 'post_type=page&p=49' );
    while ( $query->have_posts() ) : $query->the_post();?>
   
   
    <?php endwhile;?>
    /******/
   











   
    /*******call post from id******/
   
    <?php
$post = get_post($id); //assuming $id has been initialized
setup_postdata($post);?>

/***************************/
   
   











   
    /*******post calling code***/
   
   
    <?php
$the_query = new WP_Query( array('cat'=> 2 , 'posts_per_page' => 2)); ?>
<?php if ( $the_query->have_posts() ) : ?>
 <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>


    <div class="section2img col-sm-6 mar30b transition">

    <div class="contr2 floatright">
        <h3 class="red-box"><?php the_title() ;?></h3>
        </div>
            <?php
  if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
     the_post_thumbnail();
       } ?></div>
    <div class="section2txt col-sm-6  mar30b  transition">
   
    <div class="contr2">
    <h2><?php the_title() ;?></h2>
        <p><?php the_content() ;?></p>
       
    </div>
   
    </div>
  <?php endwhile; ?>
    <?php wp_reset_postdata(); ?>
<?php endif; ?>
   
   
   
    /******/
   
   
   
   
   








   
   
    /**pagination code **/
   
   <?php function wpbeginner_numeric_posts_nav() {

 if( is_singular() )
  return;

 global $wp_query;

 /** Stop execution if there's only 1 page */
 if( $wp_query->max_num_pages <= 1 )
  return;

 $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1;
 $max   = intval( $wp_query->max_num_pages );

 /** Add current page to the array */
 if ( $paged >= 1 )
  $links[] = $paged;

 /** Add the pages around the current page to the array */
 if ( $paged >= 3 ) {
  $links[] = $paged - 1;
  $links[] = $paged - 2;
 }

 if ( ( $paged + 2 ) <= $max ) {
  $links[] = $paged + 2;
  $links[] = $paged + 1;
 }

 echo '<div class="navigation"><ul>' . "\n";

 /** Previous Post Link */
 if ( get_previous_posts_link() )
  printf( '<li>%s</li>' . "\n", get_previous_posts_link() );

 /** Link to first page, plus ellipses if necessary */
 if ( ! in_array( 1, $links ) ) {
  $class = 1 == $paged ? ' class="active"' : '';

  printf( '<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url( get_pagenum_link( 1 ) ), '1' );

  if ( ! in_array( 2, $links ) )
   echo '<li>…</li>';
 }

 /** Link to current page, plus 2 pages in either direction if necessary */
 sort( $links );
 foreach ( (array) $links as $link ) {
  $class = $paged == $link ? ' class="active"' : '';
  printf( '<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url( get_pagenum_link( $link ) ), $link );
 }

 /** Link to last page, plus ellipses if necessary */
 if ( ! in_array( $max, $links ) ) {
  if ( ! in_array( $max - 1, $links ) )
   echo '<li>…</li>' . "\n";

  $class = $paged == $max ? ' class="active"' : '';
  printf( '<li%s><a href="%s">%s</a></li>' . "\n", $class, esc_url( get_pagenum_link( $max ) ), $max );
 }

 /** Next Post Link */
 if ( get_next_posts_link() )
  printf( '<li>%s</li>' . "\n", get_next_posts_link() );

 echo '</ul></div>' . "\n";

}
?>
  /****************************/
 











 
 
  /*************calling pagination code *****************/

    <div class="col-sm-12 pagination">
  <?php //twentythirteen_paging_nav(); ?>
 <div class="navigation">
         <?php wpbeginner_numeric_posts_nav(); ?>
        </div>
        </div>


/*********************/














/****code to call custom field**/


<?php
                $key_1_value = get_post_meta( get_the_ID(), 'para', true );

                // check if the custom field has a value

                if( ! empty( $key_1_value ) ) {

                 echo do_shortcode($key_1_value);

                }
?>
/**********/
               













/*********************slider code******************************/    

 <!-- Wrapper for slides -->
              <div class="carousel-inner">
               <?php
$class_active="active";

$args=array(
  'cat'=> 22,
  'post_status' => 'publish',
  'posts_per_page' => 3,
 
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
  while ($my_query->have_posts()) : $my_query->the_post(); ?>
             
                <div class="item <?php echo $class_active ;?>">
               
                  <div class="carousel-caption">
                  <p> <?php echo the_content();?> </p>
              </div>
                  </div>
                   <?php
$class_active="";
  endwhile;
}
wp_reset_query();  // Restore global post data stomped by the_post().
?>
                 
 
                </div>


//////////////////////////////////////////////////////////////          
             
              custumn field image calling
               
                <?php $imageid = get_post_meta($post->ID, 'image', true);?>
<?php $size = "medium";?>

<?php if($imageid){?>
<img src="<?php echo wp_get_attachment_url( $imageid, $size ); ?>" />

<?php } else{?>




<div class="field-data">

<p><?php echo get_field("data");?></p>
</div>

<?php }?>

Alternative content