Open app/setup.php
, find the after_setup_theme
action and put add_theme_support('woocommerce');
inside the function.
Add the templates you want to override in resources/woocommerce
:
theme
│
function my_acf_block_render_callback( $block ) { | |
$slug = str_replace('acf/', '', $block['name']); | |
$block['slug'] = $slug; | |
$block['classes'] = implode(' ', [$block['slug'], $block['className'], $block['align']]); | |
echo \App\template("blocks/${slug}", ['block' => $block]); | |
} |
{{-- | |
Title: Témoignage | |
Description: test | |
Category: formatting | |
Icon: admin-comments | |
Keywords: testimonial quote | |
--}} | |
<blockquote data-{{$block['id']}} class="{{$block['classes']}}"> | |
<p>{{the_field('testimonial')}}</p> |
// Make the search to index custom | |
/** | |
* Extend WordPress search to include custom fields | |
* http://adambalee.com | |
* | |
* Join posts and postmeta tables | |
* http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join | |
*/ | |
function cf_search_join( $join ) { | |
global $wpdb; |
<?php | |
add_filter('learndash_mark_complete', function($return, $post) { | |
$course_hide_markcomplete = 0; | |
if(learndash_get_course_id($post->ID) == $course_hide_markcomplete) { | |
$return = ''; | |
} | |
return $return; | |
}, 10, 2); |
#!/bin/bash | |
lines=$(tput lines) | |
cols=$(tput cols) | |
awkscript=' | |
{ | |
lines=$1 | |
random_col=$3 | |
letter=$4 |
<?php | |
/* | |
* ----------------------------------------------------------------------------- | |
* Advanced Custom Fields Modifications | |
* ----------------------------------------------------------------------------- | |
*/ | |
function PREFIX_apply_acf_modifications() { | |
?> | |
<style> |
/** | |
* Extend WordPress search to include custom fields | |
* | |
* https://adambalee.com | |
*/ | |
/** | |
* Join posts and postmeta tables | |
* | |
* http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join |
/*Contact form 7 remove span*/ | |
add_filter('wpcf7_form_elements', function($content) { | |
$content = preg_replace('/<(span).*?class="\s*(?:.*\s)?wpcf7-form-control-wrap(?:\s[^"]+)?\s*"[^\>]*>(.*)<\/\1>/i', '\2', $content); | |
$content = str_replace('<br />', '', $content); | |
return $content; | |
}); |