This file contains 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('manage_edit-shop_order_columns', 'edit_shop_order_columns'); | |
function edit_shop_order_columns($columns) | |
{ | |
$columns = array( | |
'cb' => '<input type="checkbox" />', | |
'order_number' => __('Order') , | |
'order_date' => __('Order Date') , | |
'order_status' => __('Status') , |
This file contains 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
function test_single_page() { | |
$post_id = get_the_ID(); | |
$closing_date = get_post_meta($post_id,'closing_date',true); | |
if($closing_date!='') { | |
$today = date("Y-m-d"); | |
$expire = date("Y-m-d",strtotime($closing_date)) ; | |
$today_dt = new DateTime($today); | |
$expire_dt = new DateTime($expire); |
This file contains 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
function prefix_custom_pre_get_posts_query( $q ) { | |
if( is_shop() || is_page('awards') ) { // set conditions here | |
$tax_query = (array) $q->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', |
This file contains 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 get_subcategory_terms( $terms, $taxonomies, $args ) { | |
$new_terms = array(); | |
$hide_category = array( 300 ); // 300 is the category id, replace it with yours | |
// if a product category and on the shop page | |
if ( in_array( 'product_cat', $taxonomies ) && !is_admin() && is_shop() ) { | |
foreach ( $terms as $key => $term ) { |
This file contains 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 | |
$featured_query = new WP_Query(); | |
$featured_query->query(array( | |
'post_type' => 'tribe_events', | |
'posts_per_page' => '1', | |
'orderby' => 'rand', | |
'eventDisplay' => 'upcoming', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'tribe_events_cat', |
This file contains 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 all links with hashes | |
$('a[href*="#"]') | |
// Remove links that don't actually link to anything | |
.not('[href="#"]'). | |
not('[href="#0"]'). | |
click(function (event) { | |
// On-page links | |
if ( | |
location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && |
This file contains 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
.navigation li a, | |
.navigation li a:hover, | |
.navigation li.active a, | |
.navigation li.disabled { | |
color: #fff; | |
text-decoration:none; | |
} | |
.navigation li { | |
display: inline; |
This file contains 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
function 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; |
This file contains 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
from spellchecker import SpellChecker | |
spell = SpellChecker() | |
word = input("Enter your Word : ") | |
if word in spell: | |
print("Correct Spelling") | |
else: | |
print("Incorrect Spelling") |
This file contains 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 callAPI($method, $url, $data){ | |
$curl = curl_init(); | |
switch ($method){ | |
case "POST": | |
curl_setopt($curl, CURLOPT_POST, 1); | |
if ($data) | |
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); | |
break; |
NewerOlder