Skip to content

Instantly share code, notes, and snippets.

@osalcedo
osalcedo / Change ‘Add to Cart’ Tex - WOOCOMMERCE
Last active August 29, 2015 14:23
Change ‘Add to Cart’ Text on Product Pages - WOOCOMMERCE
/** Change ‘Add to Cart’ Text on Product Pages **/
add_filter( 'add_to_cart_text', 'woo_custom_cart_button_text' ); // < 2.1
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); // 2.1 +
function woo_custom_cart_button_text() {
return __( 'Buy Now!', 'woocommerce' );
}
@osalcedo
osalcedo / Dashboard Support Widget - FUNCTIONS.PHP
Created May 20, 2015 17:13
Dashboard Support Widget - FUNCTIONS.PHP
/** Dashboard Support Widget **/
function eline_dashboard_widget() {
echo "<p style='color:red; font-size:200%; font-weight:bold'>Have any questions or need help?</p>
<p style='color:blue; font-size:200%'>Send us an email by clicking <a style='color:blue; text-decoration:underline; font-weight:bold' title='Send an email to eLine Studio' href='mailto:orlando@elinestudio.com?Subject=Support%20Message' target='_top'>HERE</a>.</p>
<p style='color:black; font-size:200%; font-weight:bold'><strong>Thank you for choosing eLine Studio!</strong></p>";
}
function add_eline_dashboard_widget() {
wp_add_dashboard_widget('eline_dashboard_widget', 'Website Support', 'eline_dashboard_widget');
}
add_action('wp_dashboard_setup', 'add_eline_dashboard_widget');
@osalcedo
osalcedo / Custom Login Screen - FUNCTIONS.PHP
Created May 20, 2015 17:11
Custom Login Screen - FUNCTIONS.PHP
/** Login Screen **/
function eline_login_logo() { ?>
<style type="text/css">
.login h1 a {
background-image: url(http://www.elinestudio.com/wp-content/uploads/2015/05/eline-logo-login.png);
padding-bottom: 0px;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'eline_login_logo' );
@osalcedo
osalcedo / Disable Theme and Plugin Editor - WP-CONFIG.PHP
Last active August 29, 2015 14:21
Disable Theme and Plugin Editor - WP-CONFIG.PHP
/** Disable Theme and Plugin Editor **/
define( 'DISALLOW_FILE_EDIT', true );
@osalcedo
osalcedo / Change Number of Default Post Revisions - WP-CONFIG.PHP
Last active August 29, 2015 14:21
Change Number of Default Post Revisions - WP-CONFIG.PHP
/** Change Number of Default Post Revisions **/
define( 'WP_POST_REVISIONS', 3 );
@osalcedo
osalcedo / border-image - CSS
Last active August 29, 2015 14:19
CSS snippet for border-image property
p {
border-style: solid;
border-width: 0px 0px 0px 15px;
-moz-border-image: url(http://border-image.png) 0 0 0 15 repeat;
-webkit-border-image: url(http://border-image.png) 0 0 0 15 repeat;
-o-border-image: url(http://border-image.png) 0 0 0 15 repeat;
border-image: url(http://border-image.png) 0 0 0 15 repeat;
}

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@osalcedo
osalcedo / Genesis Footer Navigation Menu - FUNCTIONS.PHP
Last active August 29, 2015 14:18
Custom Footer Navigation Menu for Genesis Themes - FUNCTIONS.PHP
@osalcedo
osalcedo / Remove Admin Bar Logo - FUNCTIONS.PHP
Last active August 29, 2015 14:18
Remove Admin Bar Logo - FUNCTIONS.PHP
/** Remove Admin Bar Logo **/
function eline_admin_bar_remove() {
global $wp_admin_bar;
/* Remove WP Menu */
$wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'eline_admin_bar_remove', 0);
@osalcedo
osalcedo / Admin Bar Hello Greeting - FUNCTIONS.PHP
Last active August 29, 2015 14:18
Custom Admin Bar Hello Greeting - FUNCTIONS.PHP
/** Admin Bar Hello Greeting **/
add_filter( 'admin_bar_menu', 'eline_howdy_to_hello', 25 );
function eline_howdy_to_hello( $wp_admin_bar ) {
$my_account = $wp_admin_bar->get_node('my-account');
$newtitle = str_replace( 'Howdy,', 'Welcome,', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtitle,
));
}