This file contains hidden or 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_action( 'get_header', 'remove_price_at_homepage' ); | |
/** | |
* Remove price display and add to chart button at homepage | |
* | |
* @see http://docs.woothemes.com/document/hooks/ | |
*/ | |
function remove_price_at_homepage() { | |
if ( is_home() || is_front_page() ) { | |
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); |
This file contains hidden or 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
/* block header */ | |
function before_block( $instance ) { | |
extract( $instance ); | |
$column_class = $first ? 'aq-first' : ''; | |
$template_title = sanitize_title_with_dashes( get_the_title( $template_id ) ); | |
echo '<div id="aq-block-'.$template_title.'-'.$number.'" class="aq-block aq-block-'.$id_base.' aq_'.$size.' '.$column_class.' cf">'; | |
} |
This file contains hidden or 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('plugin_row_meta', 'register_plugins_links', 10, 2); | |
/** | |
* Add Additional Links To The WordPress Plugin Admin | |
* | |
* @see http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin | |
*/ | |
function register_plugins_links ($links, $file) { | |
$base = plugin_basename(__FILE__); | |
if ($file == $base) { | |
$links[] = '<a href="admin.php?page=settings_plugin">' . __('Settings') . '</a>'; |
This file contains hidden or 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
/** | |
* Aqua Page Builder block API | |
* | |
* @link https://github.com/sy4mil/Aqua-Page-Builder/wiki/Block-API | |
*/ | |
class My_Custom_Block extends AQ_Block { | |
function __construct() { | |
// block actual processes | |
} |
This file contains hidden or 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 | |
function sharelinks( $atts ){ | |
$links = get_transient('share_links' . get_the_ID() ); | |
if($links === false){ | |
// add the links you want | |
$links = "<a href='https://www.facebook.com/sharer.php?u=" . urlencode( get_permalink() ) . "&t=" . get_the_title(). "'></a>"; | |
This file contains hidden or 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 | |
/** | |
* automatically echo to the screen using transient | |
* | |
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/ | |
* / | |
$loop_output = get_transient( 'loopOutput' ); | |
if ( false === $loop_output ) { | |
This file contains hidden or 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 | |
/** | |
* Using caching for theme options | |
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/ | |
* / | |
function my_get_cache_option($option_name = 'ThemeAdminOptions' ){ | |
// get wanted transient | |
$value = get_transient( $option_name ); | |
// check if it has any content | |
if(false === $value){ |
This file contains hidden or 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 | |
/** | |
* Caching Widgets with transients | |
* | |
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/ | |
* / | |
class show_ak_events_Widget extends WP_Widget { | |
function show_ak_events_Widget() { | |
/* Widget settings. */ |
This file contains hidden or 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 | |
/** | |
* Using transients on a single loop inside WordPress | |
* | |
* @link http://speckyboy.com/2011/12/14/website-speed-part-3-caching-wordpress/ | |
* / | |
$loop = get_transient( 'loop' ); | |
if ( false === $loop ) { | |
// Show the last 100 tweets from the custom post type tweets. |
This file contains hidden or 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 | |
add_action( 'init', 'ayo_redirect_plugin_activation' ); | |
function ayo_redirect_plugin_activation(){ | |
global $pagenow; | |
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'plugins.php' ) | |
wp_redirect( admin_url( 'options-general.php?page=plugin-page-slug' ) ); | |
exit; | |
} |