This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create an image control in the Customizer with an ID of 'logo_url'. | |
* | |
* This is added to the 'title_tagline' section. | |
*/ | |
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo_url', | |
array( | |
'settings' => 'logo_url', | |
'section' => 'title_tagline', | |
'label' => __( 'Logo', 'my_theme' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retina image control. | |
* | |
* Essentially, you just create two separate image controls, one of which is for the regular version of the logo, | |
* the other for the retina version. | |
* | |
* This is a simple solution with a few downsides: | |
* | |
* 1. It can be confusing for users who may not understand what is required for a retina version. | |
* 2. There is nothing enforcing the 2x sizing of the retina version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retina image control. | |
* | |
* This solution involves creating a new control, implemented as the | |
* Sofa_Customizer_Retina_Image_Control class. | |
* | |
* Using this control, we get a regular image control with a simple | |
* checkbox underneath asking the user whether the image is retina-ready. | |
* This means that the user can just upload a single image and tick a box | |
* if it is correctly sized for retina screens (i.e. it's twice the size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
if ( ! class_exists( 'WP_Customize_Control' ) ) return; | |
if ( ! class_exists( 'Sofa_Customizer_Retina_Image_Control' ) ) : | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps aux | grep httpd | grep -v pts | awk '{ tot += $6; procs += 1; print $2,$6,$11 } END { print "TOTAL: ",tot,"/",procs,"=",tot/procs }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch -n 1 "echo -n 'Apache Processes: ' && ps -C httpd --no-headers | wc -l && free -m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Based on a single key, retrieve the data for a particular image, including whether it is retina and its dimensions. | |
* | |
* @param string $key | |
* @return false if not set, or array if set | |
* @access private | |
* @since 1.0 | |
*/ | |
private function get_image_data($key) { | |
$data = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set the default colour used by Charitable. | |
* | |
* @return string | |
*/ | |
function checkout_charitable_default_colour() { | |
return '#37BF91'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is designed to be a drop-in replacement for the donation button in the campaign loop. | |
* | |
* Instead of linking to the donation page, it links to the campaign page. The text is changed to Read More. | |
* | |
* Save this file at yourtheme/charitable/campaign-loop/donation-link.php | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Campaign stats. | |
* | |
* This is a variation of the default template provided in Reach. Instead of showing the percentage funded, it shows | |
* the actual funded amount. It also shows the goal amount. | |
* | |
* This should be saved to your-child-theme/charitable/campaign-loop/stats.php | |
* | |
* @package Reach |
OlderNewer