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 / 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-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-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 ){
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 / 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: