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 | |
defined( 'ABSPATH' ) || exit; | |
class BikeRide_Simple_Widget extends WC_Widget { | |
private $meta_key = ''; | |
private $meta_prefix = '_bike_'; | |
/** | |
* Constructor. |
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 | |
To enable PHP in Apache add the following to httpd.conf and restart Apache: | |
LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so | |
<FilesMatch \.php$> | |
SetHandler application/x-httpd-php | |
</FilesMatch> | |
Finally, check DirectoryIndex includes index.php | |
DirectoryIndex index.php index.html |
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
1. wp core download | |
2. wp config create --dbname=altr --dbuser=admin --dbpass=1 --extra-php <<PHP | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
PHP | |
3. Open wp-config.php and change $table_prefix | |
4. wp db create | |
5. wp core install --url=http://localhost:8888/lifeisgood/altr_fe/ --title=altr --admin_user=admin --admin_password=1 [email protected] |
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
add_filter( 'the_content', 'prefix_change_hello_to_morning' ); | |
function prefix_change_hello_to_morning( $content ) { | |
if ( is_admin() ) { | |
return $content; | |
} | |
$post_id = get_the_ID(); | |
$post_type = get_post_type( $post_id ); |
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
JPEG | |
find . -iname "*.jpg" -exec jpegoptim --strip-all -m85 -o -p {} \; - ok | |
find ./ -name "*.jpg" -type f -exec jpegtran -copy none -optimize -progressive -outfile {} {} \; | |
jpegoptim.exe --strip-all -m85 -o -p *.jpg | |
PNG |
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
add_filter( 'cherry_services_default_icon_format', 'foo_cherry_services_default_icon_format' ); | |
function foo_cherry_services_default_icon_format( $icon_format ) { | |
return '<i class="linearicon %s"></i>'; | |
} |
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
add_filter( 'cherry_sidebar_post_type', 'my_prefix_add_custom_sidebars_support' ); | |
function my_prefix_add_custom_sidebars_support( $post_types ) { | |
$post_types[] = 'my-post-type-name-slug'; // tm-property | |
return $post_types; | |
} |
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
// Add code below in your theme `includes/custom-function.php` file. | |
add_action( 'wp_enqueue_scripts', 'theme55574_back_latest_jquery', 10 ); | |
function theme55574_back_latest_jquery() { | |
$suffix = SCRIPT_DEBUG ? '' : '.min'; | |
wp_deregister_script( 'jquery' ); | |
wp_deregister_script( 'migrate' ); | |
wp_enqueue_script( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.12.4' ); |
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
/* hooks.php*/ | |
// Remove navigation for Testimonials slider. | |
add_filter( 'tm_testimonials_loop_after', '__tm_remove_testi_slider_nav', 1, 2 ); | |
function __tm_remove_testi_slider_nav( $inner, $args ) { | |
remove_filter( 'tm_testimonials_loop_after', array( 'TM_Testimonials_Hook', 'slider_navigation' ), 10 ); | |
return $inner; | |
} |
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
if ( class_exists( 'Cherry_Callback_Likes' ) && class_exists( 'Cherry_Callback_Dislikes' ) ) { | |
$like = Cherry_Callback_Likes::get_instance(); | |
$dislike = Cherry_Callback_Dislikes::get_instance(); | |
echo $like->get_likes(); | |
echo $dislike->get_dislikes(); | |
} |
NewerOlder