This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"basics": { | |
"name": "Himanshi Gupta", | |
"label": "Account Executive", | |
"image": "", | |
"summary": "An Accounts Executive with work experience of three years looking forward to pursuing a higher role in the field of audit and accounting. To work in a highly challenging and competitive environment where I would be able to explore my abilities and hence contribute to the best of myself towards the growth of the organization as well as myself.", | |
"email": "[email protected]", | |
"phone": "+91-896-227-4042", | |
"location": { | |
"address": "16B Gopal Chandra Mukherjee Road.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.ID AS order_id, | |
p.post_date AS order_date, | |
woi.order_item_name AS product_title, | |
woim.meta_key | |
FROM wp_posts AS p | |
INNER JOIN wp_woocommerce_order_items AS woi ON p.ID = woi.order_id | |
INNER JOIN wp_woocommerce_order_itemmeta AS woim ON woi.order_item_id = woim.order_item_id | |
WHERE p.post_type = 'shop_order' | |
AND p.post_status IN ('wc-completed', 'wc-processing', 'wc-on-hold') | |
AND woim.meta_key = '_product_id' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//_related_ids => a:4:{i:0;i:2462;i:1;i:2466;i:2;i:2469;i:3;i:2472;} | |
//manage_product_posts_custom_column | |
add_filter('manage_edit-product_columns', 'related_product_col'); | |
function related_product_col($columns) { | |
$new_columns = (is_array($columns)) ? $columns : array(); | |
$new_columns['RELATED'] = 'Related Product'; | |
return $new_columns; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#---------------------------------------------------- | |
# MySQL Database backup script; which the created file to an another server. | |
# Created on: 28 Oct, 2016. | |
# Version: 2 | |
#---------------------------------------------------- | |
FILE=/home/username/public_html/backup_dir/my_db_file.sql.`date +"%Y%m%d"` | |
# (1) set up all the mysqldump variables | |
DBSERVER=db_host | |
DATABASE=db_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add new rewrite rule | |
*/ | |
function create_new_url_querystring() { | |
add_rewrite_rule( | |
'blog/([^/]*)$', | |
'index.php?name=$matches[1]', | |
'top' | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function delete_associated_media($id) { | |
$media = get_children(array( | |
'post_type' => 'attachment', | |
'post_parent' => $id, | |
'post_status' => 'inherit', | |
//'post_mime_type' => 'image/jpeg', | |
'numberposts' => -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2); | |
function special_nav_class($classes, $item){ | |
if( in_array('current-menu-item', $classes) ){ | |
$classes[] = 'active '; | |
} | |
return $classes; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_get_attachment( $attachment_id ) { | |
$attachment = get_post( $attachment_id ); | |
return array( | |
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), | |
'caption' => $attachment->post_excerpt, | |
'description' => $attachment->post_content, | |
'href' => get_permalink( $attachment->ID ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//to include search result | |
function searchfilter($query) { | |
if ($query->is_search && !is_admin() ) { | |
$query->set('post_type',array('post','page', 'readers-corners', 'todays-facts')); | |
} | |
return $query; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Remove WooCommerce Generator Tag in Version 2.1.0+ | |
function remove_woo_commerce_generator_tag() | |
{ | |
remove_action('wp_head','wc_generator_tag'); | |
} | |
add_action('get_header','remove_woo_commerce_generator_tag'); | |
//Remove WP Generator Meta Info: |
NewerOlder