Skip to content

Instantly share code, notes, and snippets.

View advokatb's full-sized avatar

advokatb

  • Ukraine
View GitHub Profile
{
"templates": [{
"id": "3e1aa306",
"title": "Contact 1",
"created_at": "2022-06-17 14:14:53",
"type": "section",
"url": "https:\/\/site.com\/portfolio\/contact-1\/",
"is_plus": false,
"thumbnail": "https:\/\/site.com\/elementor-library\/templates\/section\/contact\/3e1aa306.png",
"tags": [],
<?php
$control->start_controls_tabs( 'container_tabs' );
$control->start_controls_tab( 'container_tab_normal', array( 'label' => __( 'Normal', 'text-domain' ) ) );
$control->end_controls_tab();
$control->start_controls_tab( 'container_tab_hover', array( 'label' => __( 'Hover', 'text-domain' ) ) );
$control->end_controls_tab();
#cookie-notice {min-width:100%!important}
.box-white {
background-color: #FFFFFF;
}
.box3, .box5, .box7 {
background: #F0EFF5 !important;
}
.gotham-lite {
font-family: "Gotham Pro Light", sans-serif !important;
}
<?php
'default' => '',
'default' => [
'unit' => 'px',
'size' => 10,
],
'default' => [
'top' => '20',
'right' => '20',
'bottom' => '20',
@advokatb
advokatb / email_if_ordertotal.php
Created September 19, 2019 10:41
WooCommerce New order notification if order total bigger than value
<?php
// New order notification if order total bigger than value
add_action( 'woocommerce_checkout_order_processed', 'devise_email_if_ordertotal_bigger_than', 20, 1 );
function devise_email_if_ordertotal_bigger_than ( $order_id ) {
$order = wc_get_order( $order_id );
$total = $order->get_total();
$total_over = 500;
<?php
/**
* Change site url in admin bar
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function admin_bar_menu_filter( WP_Admin_Bar $wp_admin_bar ) {
$new_url = 'site.org';
$site_name_node = $wp_admin_bar->get_nodes()['site-name'];
$site_name_node->href = $new_url;
<?php
/* Display only children of current category in Woocommerce product categories widget */
add_filter('woocommerce_product_categories_widget_args','woo_current_product_category');
function woo_current_product_category( $args ){
global $wp_query, $post, $woocommerce;
$include = array();
$category_parent = '';
@advokatb
advokatb / functions.php
Created February 14, 2017 14:33
Internal CSS for WordPress Homepage
<?php if( is_home() || is_front_page() ) : ?>
<style id="my-internal-css">
#main_content .container {
position: relative;
padding: 120px 0;
}
</style>
<?php endif; ?>
@advokatb
advokatb / Gravity Forms and Fancybox
Created November 10, 2015 13:27 — forked from mandiwise/Gravity Forms and Fancybox
Using Gravity Forms with a modal and ajax
<div id="voting-form" style="display:none">
<?php echo do_shortcode( '[gravityform id="6" title="false" description="false" ajax="true"]' ) ?>
</div>
<a href="#voting-form" class="fancybox button">Vote Now</a>
add_filter( 'job_manager_application_email_subject', 'custom_job_manager_application_email_subject', 10, 2 );
// This is your hooked in function. Note: the $post variable is only available after v1.11.2
function custom_job_manager_application_email_subject( $subject, $post ) {
// By default, $subject will contain: Job Application via "X" listing on X. Change that below
$subject = 'New subject';
// Return the new subject
return $subject;
}