Posts

Showing posts from 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&#

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'

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="<

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',

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>

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 ); /////