Skip to content

Instantly share code, notes, and snippets.

View maagmirror's full-sized avatar
☄️
easteregg

Maag maagmirror

☄️
easteregg
View GitHub Profile
@media (max-width: 600px){
/* #logo img {
position: initial;
display: block;
width: 40px;
height: auto;
} */
p{
font-size: 1.5em!important;
}
function shortcode_nibiru() {
if(is_front_page()){
return '<p>' . get_bloginfo('name') . " " . date('Y') .' <a href="https://nibiru.com.uy" rel="dofollow">Diseño Web Uruguay</a></p>';
}else{
return '<p>' . get_bloginfo('name') . " " . date('Y');
}
}
add_shortcode('nibiru_footer', 'shortcode_nibiru');
<?php if($_SERVER['REQUEST_URI'] == '/') { ?>
<h1>homepage</h1>
<?php } ?>
function validation_digit(ci){
var a = 0;
var i = 0;
if(ci.length <= 6){
for(i = ci.length; i < 7; i++){
ci = '0' + ci;
}
}
for(i = 0; i < 7; i++){
a += (parseInt("2987634"[i]) * parseInt(ci[i])) % 10;
@maagmirror
maagmirror / resize.php
Created September 23, 2020 19:31
dummy php to resize images with url
<?php
$img = $_GET['img'];
$height = $_GET['height'];
$width = $_GET['width'];
$remote_file = $img;
$new_width = $width;
$new_height = $height;
<div class="yith-wcwl-add-button add-to-fav-custom">
<a href="?add_to_wishlist=<?php echo $related_product->get_id(); ?>" rel="nofollow" data-product-id="<?php echo $related_product->get_id(); ?>" data-product-type="simple" data-original-product-id="<?php echo $related_product->get_id(); ?>" class="add_to_wishlist single_add_to_wishlist" data-title="Añadir a la lista de deseos">
<i class="fa fa-heart-o"></i>
</a>
</div>
<?php woocommerce_product_loop_start(); ?>
<?php foreach ( $related_products as $related_product ) : ?>
<?php
$post_object = get_post( $related_product->get_id() );
setup_postdata( $GLOBALS['post'] =& $post_object ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited, Squiz.PHP.DisallowMultipleAssignments.Found
wc_get_template_part( 'content', 'product' );
DELETE relations.*, taxes.*, terms.*
FROM wp_term_relationships AS relations
INNER JOIN wp_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN wp_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product');
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
DELETE FROM wp_posts WHERE post_type = 'product';
@maagmirror
maagmirror / wtf
Created June 1, 2020 23:34
modal
<style>
.forcefullwidth_wrapper_tp_banner{
display:none;
}
.footerfake{
display:none;
}
@media only screen and (max-width: 600px) {
.mapouter {
display:none!important;
@-moz-document domain("web.whatsapp.com")
{
:root
{
--dark: #1f232a;
--darken: #252a33;
--darker: #333943;
--light: #e9e9e9;
--lighter: #a1a1a1;
--accent: #7289da;