Skip to content

Instantly share code, notes, and snippets.

Francisco arenas dospuntocero

Block or report user

Report or block dospuntocero

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dospuntocero / add_input_woocommerce_product.php
Created Sep 18, 2019
Add input field to products - WooCommerce
View add_input_woocommerce_product.php
* @snippet Add input field to products - WooCommerce
* @how-to Watch tutorial @
* @author Rodolfo Melogli
* @compatible WooCommerce 3.5.7
* @donate $9
// -----------------------------------------
// 1. Show custom input field above Add to Cart
dospuntocero / variations-add-to-cart.php
Created Aug 21, 2019
using a list of variations instead of a combobox on product pages
View variations-add-to-cart.php
function woocommerce_variable_add_to_cart() {
global $product, $post;
$variations = $product->get_available_variations();
foreach ($variations as $key => $value) {
dospuntocero / gist:95941beb334990c3ffd9cfc3fa613ff3
Created Aug 3, 2019
install composer globally using mamp's PHP
View gist:95941beb334990c3ffd9cfc3fa613ff3
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'
dospuntocero / remove-h1.php
Created Jun 28, 2019
how to remove h1 from the wordpress classic editor
View remove-h1.php
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' );
dospuntocero / show-children-pages.php
Last active Jun 27, 2019
show children pages of current page
View show-children-pages.php
<div class="solutions-holder">
<div class="wrapper">
$args = [
'post_parent' => $post->ID,
'post_type' => 'page',
'orderby' => 'menu_order'
$child_query = new WP_Query( $args );
dospuntocero / features-list.php
Created Jun 27, 2019
getting a list of features from an ACF repeater and split it in 2 different balanced lists
View features-list.php
<div class="solution-features-list">
$features = [];
if ( have_rows( 'features' ) ) :
while ( have_rows( 'features' ) ) : the_row();
array_push($features, get_sub_field( 'feature' ));
dospuntocero / complex query
Last active Jun 13, 2019
i have a product with 2 taxonomies and i need to filter the ones that belongs to one specific taxonomy and at the same time, order the objects by category
View complex query
* Template Name: Product
<main class="wrapper">
dospuntocero / get_template_part_extra()
Last active Jun 12, 2019
wordpress get_template_part_extra() lets you pass an array of variables to the template
View get_template_part_extra()
<?php //called like this on other template get_template_part_extra('templates/products_accordion',[ 'key'=>'protection'] ); ?>
//inside the partial...
<?php echo( $template_args['key'] ); ?>
View “People You May Know.” “Suggested Friends.” “Suggestions for you.”
a = setInterval(function () {
}, 3000);
dospuntocero / How to create a Custom Post type template that uses a divi layout directly
Last active May 31, 2019
How to create a Custom Post type template that uses a divi layout directly
View How to create a Custom Post type template that uses a divi layout directly
## first in your functions.php add the following:
//Shortcode to show the module
function showmodule_shortcode($moduleid) {
extract( shortcode_atts( array('id' =>'*'), $moduleid ) );
return do_shortcode('[et_pb_section global_module="'.$id.'"][/et_pb_section]');
add_shortcode('showmodule', 'showmodule_shortcode');
## then create your single-customCPT.php file duplicating page.php from divi and look for line 45 :
You can’t perform that action at this time.