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
//Function for customize default design of comment template | |
function glowlogix_comment($comment, $args, $depth) { | |
if ( 'div' === $args['style'] ) { | |
$tag = 'div'; | |
$add_below = 'comment'; | |
} else { | |
$tag = 'li'; | |
$add_below = 'div-comment'; | |
} | |
?> |
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
// create post comment button | |
function glowlogix_comment_button() { | |
echo '<input name="submit" type="submit" class="btn margin-top-20" value="Send">'; | |
} | |
add_action( 'comment_form', 'glowlogix_comment_button' ); | |
For remove default button add "display: none" property in your style.css file |
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
function glowlogix_comment_field($comment_field){ | |
$comment_field = | |
'<li class="col-sm-12"> | |
<textarea required placeholder="MESSAGE" class="form-control" name="comment" aria-required="true"></textarea> | |
</li>'; | |
return $comment_field; | |
} | |
add_filter('comment_form_field_comment', 'glowlogix_comment_field'); |
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
$fields = array( | |
'author' => '<ul class="row"><li class="col-sm-6"><label>' . '<input class="form-control" id="author" name="author" type="text" placeholder="' . esc_attr__( "Name", "text-domain" ) . '" value="' . esc_attr( $commenter['comment_author'] ) . '" size=""' . $aria_req . ' /></label></li>', | |
'email' => '<li class="col-sm-6"><label>' . '<input class="form-control" name="email" type="text" placeholder="' . esc_attr__( "Email", "text-domain" ) . '" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size=""' . $aria_req . ' /></label></li>', | |
); | |
comment_form(array('fields'=>$fields)); |
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
// create shortcode to list all clothes which come in blue | |
function statesmen_news_shortcode( $atts ) { | |
$html = ''; | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'post_per_page' => '2', | |
'post_type' => 'post', | |
'id' => false | |
), |
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
add_action( 'wc_gateway_stripe_process_response', 'prefix_wc_gateway_stripe_process_response', 20, 2 ); | |
function prefix_wc_gateway_stripe_process_response( $response, $order ){ | |
if($response->source->type == 'three_d_secure'){ | |
$order->update_status('completed', 'order_note'); #### | |
//WC_Stripe_Logger::log( 'wc_gateway_stripe_process_response three_d_secure response: ' . print_r( $response->source->type, true ) ); | |
}elseif($response->source->type == 'card'){ | |
$order->update_status('failed', 'order_note'); #### | |
//WC_Stripe_Logger::log( 'wc_gateway_stripe_process_response card response: ' . print_r( $response->source->type, true ) ); | |
} | |
} |
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
add_action( 'woocommerce_thankyou', 'bbloomer_redirectcustom'); | |
function bbloomer_redirectcustom( $order_id ){ | |
$order = new WC_Order( $order_id ); | |
$url = 'https://siteurl/thank-you-payment/'; //Thank you page | |
$mem_url = 'https://siteurl/payment-denied/'; // denied page | |
if ( $order->status == 'pending' ) { | |
wp_redirect($mem_url); | |
} | |
else{ |
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
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "http://www.zillow.com/webservice/GetDeepSearchResults.htm", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", |
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
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP'];} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} | |
$url = "http://api.wipmania.com/".$ip; | |
$country = file_get_contents($url); | |
echo $country; |
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<select name="select1" id="select1"> | |
<option country-code="pk" value="Pakistan">Pakistan</option> | |
<option country-code="in" value="India">India</option> | |
<option country-code="us" value="Usa">USA</option> | |
<option country-code="uk" value="Uk">United Kingdom</option> | |
<option country-code="fr" value="France">France</option> | |
<option country-code="gr" value="Germny">Germny</option> | |
<option country-code="it" value="Italy">Italy</option> | |
<option country-code="ch" value="China">China</option> |