Skip to content

Instantly share code, notes, and snippets.

View jmslbam's full-sized avatar
💭
Available for (WordPress) work

Jaime Martínez jmslbam

💭
Available for (WordPress) work
View GitHub Profile
@jmslbam
jmslbam / taxonomy.php
Created January 4, 2012 09:02
Custom taxonomy - term title
$s_title = single_cat_title('', false);
$s_title = str_replace(' @en', '', $title);
@jmslbam
jmslbam / archive-template.php
Created January 4, 2012 09:21
Custom Post Type Archive with WPML
<?php
/* Template Name: News Archive */
?>
<?php
include('archive.php');
?>
<?php
/* don't forget to put these in your functions.php */
@jmslbam
jmslbam / setup.sh
Created November 1, 2012 22:58
Wordpress wp-cli install bash
#!/bin/bash
#
# This script has been adapted from the drush wrapper script
# and all credit should go to the authors of that project:
# http://drupal.org/project/drush
# Get the absolute path of this executable
ORIGDIR=$(pwd)
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
@jmslbam
jmslbam / settings.php
Created November 3, 2012 22:51
Settings.php
<?php
$settings = array(
'DB_HOST' => 'localhost',
'DB_NAME' => '%DBNAME%',
'DB_USER' => '%DBUSER%',
'DB_PASSWORD' => '%DBPASS%',
'DOMAIN_CURRENT_SITE' => '%SITEURL%',
'WP_DEBUG' => TRUE,
'ENVIRONMENT' => 'dev',
'ACF_REPEATER' => "",
@jmslbam
jmslbam / httpd.conf
Created November 4, 2012 14:59
WP vhost conf
<VirtualHost *:80>
ServerName local.%PROJECT%
ServerAlias local.%PROJECT%
DocumentRoot %DOCROOT%
<Directory "%DOCROOT%/">
Options Indexes FollowSymLinks
@jmslbam
jmslbam / wp-cli-snippets.sh
Last active July 8, 2017 03:00
WP-CLI snippet solutions collected from WP-CLI issues
#!/bin/bash
# Provide a way to upgrade the network after `wp core update`
# https://github.com/wp-cli/wp-cli/issues/683
for url in $(wp site list --fields=url --format=csv | tail -n +2)
do
wp --url=$url core update-db
done
@jmslbam
jmslbam / functions.php
Created July 13, 2014 11:56
Change WooCommerce ordernumber prefix
add_filter( 'woocommerce_order_number', 'jm_woocommerce_order_number', 1, 2 );
/**
* Remove # prefix from WooCommerce Order Number
* Could also be done with gettext: https://github.com/woothemes/woocommerce/blob/master/includes/abstracts/abstract-wc-order.php#L537
*
*/
function jm_woocommerce_order_number( $oldnumber, $order ) {
return str_replace('#', '', $order->id);
}
@jmslbam
jmslbam / gist:f5a921c399d8fe6dc762
Created May 28, 2015 22:10
FacetWP Selections with reset
<div id="selected-filters" class="selected-filters">
<h4><?php _e('Selected filters','rc'); ?>:</h4>
<?php echo facetwp_display('selections'); ?>
<span class="facetwp-reset" onclick="FWP.reset()"><?php _e('reset all filters','rc'); ?></span>
</div>
@jmslbam
jmslbam / composer.json
Created December 11, 2015 08:17
Clarkson Core via Composer
{
"name": "level-level/wp-clarkson.com",
"type": "project",
"license": "MIT",
"description": "A modern WordPress development",
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},