-
cd /var/www/ -
sudo mkdir -p subdomain/public_html -
cd subdomain/pub* -
sudo chown $USER:$USER -R . -
wp core download -
sudo chown www-data:www-data -R .
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
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <!-- import CSS --> | |
| <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> | |
| </head> | |
| <body> |
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
| filtered_boats: function () { | |
| let filtered = this.boats; | |
| // the minimums | |
| let mins = { | |
| "minPrice": 'price', | |
| "minLength": 'length', | |
| ... | |
| }; |
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
| <body | |
| class="text-gray-700 bg-white" | |
| style="font-family: 'Source Sans Pro', sans-serif" | |
| > | |
| <!--Nav--> | |
| <nav> | |
| <div | |
| class="container mx-auto px-6 py-2 flex justify-between items-center" | |
| > | |
| <a class="font-bold text-2xl lg:text-4xl" href="#"> |
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
| /** | |
| * goes inside your beloved functions.php | |
| */ | |
| add_shortcode( 'recently_viewed_products', 'code_recently_viewed_products' ); | |
| function code_recently_viewed_products() { | |
| $viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', wp_unslash( $_COOKIE['woocommerce_recently_viewed'] ) ) : array(); | |
| $viewed_products = array_reverse( array_filter( array_map( 'absint', $viewed_products ) ) ); |
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
| <? | |
| // /product-options-for-woocommerce/Model/Option.php | |
| public function saveOptions($productId, $options) { | |
| $productId = (int)$productId; | |
| // Här kommer alla värden samlas upp efter loopen | |
| // tänk på att loopen svarar RAD FÖR RAD | |
| $lens_options = array(); |
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
| # This command will be generating a TXT-string you'll need to enter into your "_acme-challenge.example.se" | |
| # When the new DNS post is live, you'll want to press ENTER in your shell to complete setup. | |
| # My setup is a Debian machine with Apache as Web Server with virtualhosts. | |
| sudo certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d "*.example.se" --preferred-challenges dns-01 certonly |
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
| <?php | |
| function my_customize_rest_cors() { | |
| remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); | |
| add_filter( 'rest_pre_serve_request', function( $value ) { | |
| header( 'Access-Control-Allow-Origin: *' ); | |
| header( 'Access-Control-Allow-Methods: GET' ); | |
| header( 'Access-Control-Allow-Credentials: true' ); | |
| header( 'Access-Control-Expose-Headers: Link', 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
| <?php | |
| /** | |
| * Simple product add to cart | |
| * | |
| * This template can be overridden by copying it to yourtheme/woocommerce/single-product/add-to-cart/simple.php. | |
| * | |
| * HOWEVER, on occasion WooCommerce will need to update template files and you | |
| * (the theme developer) will need to copy the new files to your theme to | |
| * maintain compatibility. We try to do this as little as possible, but it does | |
| * happen. When this occurs the version of the template file will be bumped and |
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
| <?php | |
| //AJAX ADD TO CART BUTTON | |
| $product_id = 143; | |
| if( !my_custom_cart_contains( $product_id ) ) { | |
| ?> | |
| <button class="my-custom-add-to-cart-button" data-product-id="<?php echo $product_id; ?>">add to cart</button> | |
| <?php | |
| } else { | |
| ?> |