Skip to content

Instantly share code, notes, and snippets.

Alain Schlesser schlessera

Block or report user

Report or block schlessera

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@schlessera
schlessera / modify-comments.php
Last active Aug 29, 2015
Add one or more classes to the WordPress comment form's 'Submit' button
View modify-comments.php
<?php
/**
* Add one or more classes to the WordPress comment form's 'Submit' button
* NB: This only works as of WordPress 4.1
* @author Alain Schlesser (alain.schlesser@gmail.com)
* @link http://www.brightnucleus.com/add-class-wordpress-comment-submit-button/
*
* @param array $arg contains all the default values used by the comment form
* @return array modified array that goes back to the comment renderer
@schlessera
schlessera / modify-search.php
Last active Aug 29, 2015
Add one or more classes to the WordPress search form's 'Search' button
View modify-search.php
<?php
/**
* Add one or more classes to the WordPress search form's 'Search' button
* @author Alain Schlesser (alain.schlesser@gmail.com)
* @link http://www.brightnucleus.com/add-class-wordpress-search-button/
*
* @param string $form the search form HTML output
* @return string modified version of the search form HTML output
*
@schlessera
schlessera / modify-search-genesis.php
Last active Aug 29, 2015
Add one or more classes to the Genesis search form's 'Submit' button
View modify-search-genesis.php
<?php
/**
* Add one or more classes to the Genesis search form's 'Submit' button
* @author Alain Schlesser (alain.schlesser@gmail.com)
* @link http://www.brightnucleus.com/add-class-wordpress-search-button/
*
* @param string $form the search form HTML output
* @param string $search_text text inside the search text entry box
* @param string $button_text caption of the search button
@schlessera
schlessera / add-svg-upload.php
Last active Aug 29, 2015
Enable SVG file upload through WordPress Media Uploader
View add-svg-upload.php
<?php
/**
* Add the SVG Mime type to the uploader
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* @param array $mimes list of mime types that are allowed by the
* WordPress uploader
* @return array modified version of the $mimes array
*
@schlessera
schlessera / adjust-svg-size.php
Last active Aug 29, 2015
Adjust the HTML that WordPress generates for SVG so they are resized to fit their container
View adjust-svg-size.php
<?php
/**
* Replace WordPress standard SVG width of 1 with 100%
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* By default, WordPress renders all SVG files uploaded through the Media
* Uploader with both width and height at "1".
*
* @param string $output HTML output that Genesis has generated for a
@schlessera
schlessera / postpone-genesis-stylesheet.php
Last active Aug 29, 2015
Postpone loading of Genesis Stylesheet so that it trumps the CSS of plugins
View postpone-genesis-stylesheet.php
<?php
/**
* Move Genesis child theme style sheet to a much later priority to give any plugins a chance to load first.
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* @see http://docs.garyjones.co.uk/genesis/2.0.0/function-genesis_load_stylesheet.html
*/
function as_postpone_genesis_stylesheet() {
@schlessera
schlessera / shortcode-copyright.php
Created Apr 4, 2015
Shortcode to display copyright notice with current year
View shortcode-copyright.php
@schlessera
schlessera / modify-stylesheet-location.php
Last active Aug 29, 2015
Modify location of main stylesheet
View modify-stylesheet-location.php
<?php
/**
* Modify location of main stylesheet
* N.B.: style.css in the theme's root is still needed to provide WordPress
* with the necessary metadata about the theme
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* @param string $stylesheet_uri Stylesheet URI for the current theme/
* child theme
@schlessera
schlessera / _reflowing-columns.scss
Created Apr 23, 2015
Reflowing columns (CSS Multi-column)
View _reflowing-columns.scss
/**
* Reflowing columns (CSS Multi-column)
*
* This defines reflowing columns in CSS. Simply apply the class with the number
* of columns you need, like .reflow-3 . The number of columns wil be reduced if
* the individual columns go below $min-column-width.
*
* IE10+ only, all but Firefox have trouble displaying <li>s inside the columns.
*
* @author Alain Schlesser <alain.schlesser@gmail.com>
@schlessera
schlessera / translatable_string.php
Last active Jan 18, 2017
Translatable string with multiple links that can be reordered and renamed
View translatable_string.php
<?php
/**
* Translatable string with multiple links that can be reordered and renamed
* @author Alain Schlesser (alain.schlesser@gmail.com)
*
* @see http://php.net/manual/function.preg-replace.php
* @see http://codex.wordpress.org/Function_Reference/_2
*/
You can’t perform that action at this time.