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