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
/** | |
* @snippet Add input field to products - WooCommerce | |
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 | |
* @author Rodolfo Melogli | |
* @compatible WooCommerce 3.5.7 | |
* @donate $9 https://businessbloomer.com/bloomer-armada/ | |
*/ | |
// ----------------------------------------- | |
// 1. Show custom input field above Add to Cart |
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
function woocommerce_variable_add_to_cart() { | |
global $product, $post; | |
$variations = $product->get_available_variations(); | |
?> | |
<table> | |
<tbody> | |
<?php | |
foreach ($variations as $key => $value) { | |
?> |
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
Create an alias for our bash profile. | |
Within the terminal, run: | |
nano ~/.bash_profile | |
add the following line: | |
alias phpmamp='/Applications/MAMP/bin/php/php7.3.1/bin/php' |
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
function remove_h1_from_editor( $settings ) { | |
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;'; | |
return $settings; | |
} | |
add_filter( 'tiny_mce_before_init', 'remove_h1_from_editor' ); |
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
<div class="solution-features-list"> | |
<?php | |
$features = []; | |
if ( have_rows( 'features' ) ) : | |
while ( have_rows( 'features' ) ) : the_row(); | |
array_push($features, get_sub_field( 'feature' )); | |
endwhile; |
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
<div class="solutions-holder"> | |
<div class="wrapper"> | |
<?php | |
$args = [ | |
'post_parent' => $post->ID, | |
'post_type' => 'page', | |
'orderby' => 'menu_order' | |
]; | |
$child_query = new WP_Query( $args ); |
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: Product | |
*/ | |
get_header(); | |
?> | |
<main class="wrapper"> |
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
afghanistan : Afghanistan | |
albania : Albania | |
algeria : Algeria | |
american_samoa : American Samoa | |
andorra : Andorra | |
angola : Angola | |
anguilla : Anguilla | |
antigua_and_barbuda : Antigua and Barbuda | |
argentina : Argentina | |
armenia : Armenia |
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
//passing variables like ?orderby=title | |
$my_query = new WP_Query( array( | |
'post_type' => 'project', | |
'post_status' => 'publish', | |
'orderby' => get_query_var('orderby'), // will return orderby query string variable | |
'order' => 'DESC', | |
'paged' => get_query_var('paged'), | |
)); |
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
if you want to know which keyboards do you have available, use this command | |
Get-WinUserLanguageList | |
if you want to add a new one and you know the languagetag and the keyboard layout you want you can use something like this | |
Set-WinUserLanguageList -LanguageList en-US, en-001 -Force | |
if you want to remove from the list of posibilities the ones you dont want to use, just do the following (pressing enter after each line): |