Skip to main content

Posts

Showing posts from 2017

woocommerce signup form addons

1)add extra fields in woocommerce function wooc_extra_register_fields() {?>        <p class="form-row form-row-wide">        <label for="reg_billing_phone"><?php _e( 'Phone', 'woocommerce' ); ?></label>        <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" />        </p>        <p class="form-row form-row-first">        <label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?><span class="required">*</span></label>        <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e...

add custom post type

/**  *  * add custom post type  *  */ function my_custom_post_product() {   $labels = array(     'name'               => _x( 'Products', 'post type general name' ),     'singular_name'      => _x( 'Product', 'post type singular name' ),     'add_new'            => _x( 'Add New', 'book' ),     'add_new_item'       => __( 'Add New Product' ),     'edit_item'          => __( 'Edit Product' ),     'new_item'           => __( 'New Product' ),     'all_items'          => __( 'All Products' ),     'vi...

call posts by calling custom post types

<?php     $lastposts = get_posts( array(         'posts_per_page' => 5 ,         'post_type'   => 'projects'     ) );     if ( $lastposts ) {         foreach ( $lastposts as $post ) :             setup_postdata( $post ); ?>                 <div class="portfolio-panel" style="background: url(' <?php the_post_thumbnail_url(); ?>')">                     <div class="panel-clickthroughs">                         <a class="company-logo-link">              ...

set default menu UL css code wordpress

<?php  $defaults = array(     'menu_class'      => 'menu',     'items_wrap'      => '<ul id="%1$s" class="navigation clearfix">%3$s</ul>', ); wp_nav_menu( $defaults ); ?> <?php                      wp_nav_menu( array(                         'theme_location' => 'primary',                         'menu_class'     => 'nav side-menu',                      ) );                 ?> /* Function to change sub-menu class Starts here */ function change_submenu_class($menu) ...

get posts from category name

     <?php //query_posts('category_name=Key Individuals&orderby=menu_order&order=ASC'); query_posts('category_name=blog-3'); //query_posts('category_name=blog&order=DESC'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-content">                     <div class="dmo-contain">                     <div class="dmo-img"> <?php //This must be in one loop if(has_post_thumbnail()) { the_post_thumbnail();                                                             }?> </div...