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 | |
$args = array( | |
'post_type' => 'product', | |
'product_cat' => 'klaviere', | |
'posts_per_page' => 3, | |
'orderby' => 'date', | |
'order' => 'DESC' | |
); | |
$loop = new WP_Query($args); | |
while ($loop->have_posts()) : $loop->the_post(); |
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
// model | |
// ts | |
export interface Post { | |
// some data for example | |
title: string; | |
content: string; | |
} | |
// service | |
// ts |
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 | |
<textarea rows="6" [value]="newPost"></textarea> // property is element property written in [] | |
<button (click)="methodName()">Btn text</button> | |
// ts | |
export class className { | |
newPost='predefined text for textarea'; | |
methodName() { | |
// do something |
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 | |
<button (click)="methodName()">Btn text</button> | |
<p>{{ newPost }}</p> | |
// ts | |
export class className { | |
newPost=''; | |
methodName() { | |
this.newPost = 'some text'; |
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
// app.module.ts | |
import { LOCALE_ID } from '@angular/core'; | |
import { registerLocaleData } from '@angular/common'; | |
import localeDe from '@angular/common/locales/de'; | |
registerLocaleData(localeDe); | |
providers: [ | |
[{ provide: LOCALE_ID, useValue: 'de-DE'}] | |
], |
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
// shortcode | |
[recent_products per_page="6" columns="6" orderby="rand" order="rand"] |
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
// https://www.templatemonster.com/help/woocommerce-how-to-set-random-order-for-products.html | |
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); | |
function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
if ( 'random_list' == $orderby_value ) { | |
$args['orderby'] = 'rand'; | |
$args['order'] = ''; |
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
// convert to number in currency format | |
var invValueFormat = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(response.result.sumCostPrice); | |
// remove dot and replace with space | |
invValueFormat = invValueFormat.replace(/\./g, ' '); |
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
// myArray = is an accual array of objects | |
// param = is a parameter in object | |
// value = is what we are looking for | |
var index = myArray.findIndex((obj => obj.param == value)); |
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
For example do not remove comment in style css fpr WP theme | |
/*! | |
*/ | |
/*! | |
Theme Name: Storefront Child Theme | |
Theme URI: https://github.com/stuartduff/storefront-child-theme | |
Author: Stuart Duff | |
Author URI: http://stuartduff.com |