Posts

Showing posts with the label wordpress-customization

How to create custom sidebar in wordpress

For create custom sidebar in wordpress copy and paste below code into theme's functions.php file or into your custom plugins file. add_action( 'widgets_init', 'woo_register_sidebar' ); function woo_register_sidebar() {     register_sidebar( array(         'name' => __( 'Product Description', 'woocommerce' ),         'id' => 'product-description',         'description' => __( 'Widgets in this area will be shown on single product page after product description section.', 'woocommerce' ),         'before_widget' => '<div class="product_description_widget">',     'after_widget'  => '</div>',     'before_title'  => '<h2 class="widgettitle">',     'after_title'   => '</h2>',     ) ); } For access custom sidebar ...

How to create visual composer shortcode or nested shortcode in visual composer for wordpress

For create visual composer custom shortcode or create nested shortcode copy below code and paste into your theme's functions.php file or custom plugin file and change according to your need. <?php class WPBakeryShortCode_michelle_item_lists  extends WPBakeryShortCodesContainer {} //Register "container" content element. It will hold all your inner (child) content elements vc_map( array(     "name" =>  __( 'Item List', 'qode' ),     "base" => "michelle_item_lists",     "as_parent" => array('only' => 'michelle_item_lists_item'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)     "content_element" => true,     "category" => 'My shortcodes',     "show_settings_on_create" => true,     "js_view" => 'VcColumnView',     "params" => array(         array(  ...

Custom password reset functionality with form for wordpress

For add a custom password reset functionality in your wordpress site or blog just copy and paste below code into new template "password reset" or whatever you want to name it. and put into your theme's folder.. <?php /* Template Name: Password Reset Template */ global $wpdb, $user_ID; function tg_validate_url() {     global $post;     $page_url = esc_url(get_permalink( $post->ID ));     $urlget = strpos($page_url, "?");     if ($urlget === false) {         $concate = "?";     } else {         $concate = "&";     }     return $page_url.$concate; } if (!$user_ID) { //block logged in users     if(isset($_POST['action']) && $_POST['action']=='save_pw_reset')     {         if ( !wp_verify_nonce( $_POST['save_pwd_nonce'], "save_reset_password"))...

How to create a custom wp_list_table and bulk action in wordpress

Below is a example of how to create a  custom wp_list_table and bulk actions.. Change below code according to your requirements. <?php global $wpdb; $table = $wpdb->prefix.'pp_buyer_package'; if($_REQUEST['action']=='delete' || $_REQUEST['action2']=='delete') {         if(isset($_REQUEST['pak_ids']) && $_REQUEST['_wpnonce']!='')     {         foreach($_REQUEST['pak_ids'] as $item)         {                $end_time = strtotime('now');             $cr_select = 'select * from '.$wpdb->prefix.'pp_package_buyer_relation where package_id = "'.$item.'" and end_time >= "'.$end_time.'"';             $cr_result =  $wpdb->get_row($cr_select);             if(count($cr...