Skip to content

Instantly share code, notes, and snippets.

View fitodac's full-sized avatar
:octocat:
now on github

fitodac fitodac

:octocat:
now on github
View GitHub Profile
@fitodac
fitodac / wordpress-6-2-2-docker-compose.yml
Created January 8, 2024 11:31 — forked from erikyuzwa/wordpress-6-2-2-docker-compose.yml
Wordpress 6.2.2 Docker Compose for Local Development
# create a local .env file with the following 4 properties:
#
# MYSQL_DATABASE=<something>
# MYSQL_USER=<something>
# MYSQL_PASSWORD=<something>
# MYSQL_ROOT_PASSWORD=<something>
#
version: "3.8"
services:
Enqueue scripts
functions.php
function smpx_scripts(){
wp_enqueue_script( 'bolsacom', get_template_directory_uri().'/assets/js/bolsacom.js', array('jquery'), rand(), true );
// PRODUCT VALORATIONS
wp_localize_script('bolsacom', '$ajax_vars', array(
'url' => admin_url( 'admin-ajax.php' ),
@fitodac
fitodac / wp-post-thumbnail.php
Created October 23, 2018 04:12
WordPress: Post thumbnail
/*-----------------------------------------------------------------------*/
/* Display different types of post thumbnails
/* USE:
/* Include this code in your functions.php file
/* Include this function inside the loop: nitro_post_thumbnail()
/* Options:
/* nitro_post_thumbnail(true) - include links to post for images
/*-----------------------------------------------------------------------*/
if( !function_exists( 'nitro_post_thumbnail' ) ):
function nitro_post_thumbnail( $link = false ){
@fitodac
fitodac / wp-empty-trash.php
Created October 23, 2018 03:36
WordPress: Empty trash automatically
/**
Empty Trash Automatically
set the number of days and reduce the size of your database.
*/
define('EMPTY_TRASH_DAYS', 5 );
@fitodac
fitodac / wp-intall-local.php
Created October 23, 2018 03:13
WordPress: Install plugins locally without
/**
Put this in wp-config.php
*/
define('FS_METHOD', 'direct');
@fitodac
fitodac / wp-redirect.txt
Last active October 23, 2018 03:11
WordPress: redirect
<?php wp_redirect( home_url() ); exit; ?>
@fitodac
fitodac / gist:480d855b53f325ee779232e316d9d0a9
Last active August 1, 2016 19:25
geolocation agroclima
var $lat,
$lon,
$ini = 0,
$ini_data_error = false;
/*------------------------------------*/
/* DATOS ACTUALES */
/*------------------------------------*/
var date = new Date(),
@fitodac
fitodac / owl-css.html
Last active June 30, 2016 18:09
Add owl css to website
<link rel="stylesheet" href="owlcarousel/owl.carousel.min.css">
<link rel="stylesheet" href="owlcarousel/owl.theme.default.min.css">
@fitodac
fitodac / CPT-in-taxonomy.php
Created June 11, 2016 22:27
Get custom post type data in taxonomy view
$currentTaxonomy = get_query_var('taxonomy');
if ($currentTaxonomy) {
$taxObject = get_taxonomy($currentTaxonomy);
var_dump($taxObject);
}
@fitodac
fitodac / wp-shortcodes.php
Created June 2, 2016 23:11
Wordpress Shorcodes
function shortURL() {
return 'https://fitodac.com/';
}
add_shortcode('myurl', 'shortURL');