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 | |
/* | |
Template Name: Category-Administrative | |
*/ | |
?> | |
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css" type="text/css" media="screen" /> | |
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 if ( is_user_logged_in() ) { ?> | |
<div class="add_post"><a href="https://youthyork.eu/frontend-editor/">Write new post</a> </div> | |
<?php } ?> | |
.add_post{ | |
-webkit-transform: rotate(-90deg); /*Поворот блока с текстом н 30 градусов*/ | |
-moz-transform: rotate(-90deg); | |
-ms-transform: rotate(-90deg); | |
-o-transform: rotate(-90deg); |
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
global $woocommerce; | |
$woocommerce->cart->empty_cart(); //чистим | |
$custom_price = $price; //$price - переменная с ценой | |
$product_id = 11963; //id любого товара | |
$quantity = 1; //кол-во | |
$cart_item_data = array('custom_price' => $custom_price); | |
$woocommerce->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation, $cart_item_data ); | |
$woocommerce->cart->calculate_totals(); | |
$woocommerce->cart->set_session(); | |
$woocommerce->cart->maybe_set_cart_cookies(); |