Skip to content

Instantly share code, notes, and snippets.

View maagmirror's full-sized avatar
☄️
easteregg

Maag maagmirror

☄️
easteregg
View GitHub Profile
@maagmirror
maagmirror / Run_jquery.js
Created January 17, 2023 23:48
jquery on wordpress
window.addEventListener('DOMContentLoaded', (event) => {
(function($) {
console.log('DOM fully loaded and parsed');
})( jQuery );
});
function start_modify_html() {
ob_start();
}
function end_modify_html() {
if(!is_user_logged_in()) {
$html = ob_get_clean();
$html = str_replace( '[paisname]', get_field('paisname', 'option'), $html );
echo $html;
add_filter( "login_headerurl", "custom_loginlogo_url" );
function custom_loginlogo_url($url) {
return "https://nibiru.com.uy";
}
function my_login_logo() { ?>
<style type="text/css">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#largescreen {
display: block;
}
#smallscreen {
display: none;
}
@media (max-width: 640px) {
#largescreen {
@maagmirror
maagmirror / v-install-wordpress-nibiru
Last active March 1, 2024 17:27
Script to install a wordpress in vesta server with changes in database name generator, add the essential plugins, generate good link structure for seo, change lang of the core to spanish, remove unused base themes
#!/bin/bash
# info: WordPress installer in one command line
# options: DOMAIN USER
#
# Credits to Luka Paunović for wp-cli implememtation
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
// Disable zip/postcode field
add_filter( 'woocommerce_checkout_fields' , 'nibiru_remove_billing_postcode_checkout' );
function nibiru_remove_billing_postcode_checkout( $fields ) {
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_state']);
return $fields;
}
@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 } ?>