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
# List server names in Nginx configuration files | |
sudo grep -r "server_name" /etc/nginx/sites-available |
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
add_shortcode('timer', 'cart_page_shipping_timer', 10); | |
function cart_page_shipping_timer() { | |
// Change timezone if needed | |
date_default_timezone_set( 'Europe/Sofia' ); | |
global $product; | |
$isInStock = $product->get_stock_quantity() > 0; | |
var_dump($product->get_stock_quantity()); |
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
$args = [ | |
'post_type' => 'post', | |
'posts_per_page' => 18, 'offset' => 0, 'order' => 'DESC', | |
'orderby' => 'date', 'post_status' => 'publish', | |
'category__not_in' => [118, 123, 147 ], | |
'taxonomy' => ['cardio','meditation','mobility','pbox','pilates','six-pack','strength','stretching','yoga'] | |
]; | |
$query = new WP_Query($args); | |
var_dump($query->have_posts()); |
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 | |
$taxonomyTypes = get_terms(['taxonomy' => 'product_types']); | |
if($taxonomyTypes){ | |
foreach( $taxonomyTypes as $taxonomyType ) { | |
$taxonomyNames = get_terms( array( | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'taxonomy' => 'product_names', |
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
// Get current route | |
function vsi_get_current_route(){ | |
$routeWithParams = explode('/', $_SERVER['REQUEST_URI'])[1]; | |
return parse_url($routeWithParams, PHP_URL_PATH); | |
} | |
add_filter( '404_template_hierarchy', 'vsi_client_routing' ); | |
function vsi_client_routing() { | |
$router = new CompanyRouter(); |