Skip to content

Instantly share code, notes, and snippets.

View rafaelbantu's full-sized avatar

Rafael Bantu rafaelbantu

View GitHub Profile
/* To disable the Gutenberg’s CSS loading on the front-end */
function tw_unload_files() {
wp_dequeue_style ( 'wp-block-library' );
wp_dequeue_style ( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 );
/* To disable Elementor’s Google font */
@rafaelbantu
rafaelbantu / gist:1f0874afb2952cd3a31de76a242c9854
Created January 24, 2021 21:32
Como adicionar tempo de leitura no WordPress sem usar o plugin
//estimated reading time
function reading_time() {
$content = get_post_field( 'post_content', $post->ID );
$word_count = str_word_count( strip_tags( $content ) );
$readingtime = ceil($word_count / 200);
if ($readingtime == 1) {
$timer = " minuto";
} else {
$timer = " minutos";
.col4-blog .et_pb_salvattore_content[data-columns]::before {
content: '4 .column.size-1of4' !important;
}
@media only screen and ( min-width: 981px ) {
.col4-blog .column.size-1of4 {
width: 24%!important;
margin-right: 1%;
}
}
.col3-blog .et_pb_salvattore_content[data-columns]::before {
content: '3 .column.size-1of3' !important;
}
@media only screen and ( min-width: 981px ) {
.col3-blog .column.size-1of3 {
width: 32% !important;
margin-right: 1%;
}
}
@rafaelbantu
rafaelbantu / remover-largura-altura-imagem-wp.txt
Created July 1, 2018 22:10
Removendo largura e altura de imagens no WordPress
<script type='text/javascript' src='https://code.jquery.com/jquery-git.min.js'></script>
<script type='text/javascript'>
jQuery(document).ready(function ($) {
$("img").removeAttr("height width");
});
</script>
<select size="1" name="jumpit" onchange="document.location.href=this.value">
<option selected value="">Selecione ...</option>
<?php
$args = array('post_type' => 'artigo', 'posts_per_page' => -1, 'order' => 'ASC');
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post(); ?>
<option value="<?php the_permalink(); ?>"><?php the_title(); ?></option>
<?php endwhile; ?>
</select>
@rafaelbantu
rafaelbantu / erro-cielo-woocommerce-3.0.txt
Created December 2, 2017 01:59
erro-cielo-woocommerce-3.0.txt
[Fri Dec 01 23:50:05.039136 2017] [:error] [pid 2498] [client 192.168.0.23:53686] PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/stevebiko.net/public_html/wp-content/plugins/cielo-woocommerce/cielo-woocommerce.php on line 78, referer: https://stevebiko.net/
[Fri Dec 01 23:50:05.112429 2017] [:error] [pid 2500] [client 200.153.173.77:7201] PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/stevebiko.net/public_html/wp-content/plugins/cielo-woocommerce/cielo-woocommerce.php on line 78, referer: https://stevebiko.net/acessibilidade/
[Fri Dec 01 23:50:05.598431 2017] [:error] [pid 2496] [client 192.168.0.23:53684] PHP Warning: include_once(/var/www/stevebiko.net/public_html/wp-content/plugins/cielo-woocommerce/includes): failed to open stream: No such file or directory in /var/www/stevebiko.net/public_html/wp-content/plugins/cielo-woocommerce/includes/class-wc-cielo-api.php on line 76
[Fri Dec 01 23:50:05.598622 2017] [:error]