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 | |
/** | |
* Frontend_box class will help you to create bootstrap style alert boxes on your theme | |
* @author Damian Logghe <info@timersys.com> | |
* @license GPL-2.0+ | |
* @link http://wp.timersys.com/how-to-create-bootstraps-style-alert-boxes-in-your-theme/ | |
* @version 1.0 | |
*/ | |
class Frontend_box { |
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
/* http://wordpress.org/plugins/popups/ | |
* Adding a custom rule to display popup only on | |
* single posts of certain category | |
* / | |
add_filter('spu/rules/rule_match/post_category', 'spu_rule_match_post_category', 12, 2); | |
function spu_rule_match_post_category($match, $rule){ | |
global $post; | |
// validate | |
if( !$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
add_filter( 'wsi/placeholders/custom_url', 'wsi_my_custom_link' ); | |
function wsi_my_custom_link() { | |
global $current_user; | |
get_currentuserinfo(); | |
//return home url with ref username | |
return site_url('?mref='.$current_user->user_login); | |
//return the same shortened with goo.gl |
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
[jetpack_subscription_form show_subscribers_total="true"] |
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 you need to show a shortcode code and double | |
* brackets ar enot working for you [[]] | |
* you can always try this | |
*/ | |
add_shortcode('raw','raw_fc'); | |
function raw_fc($atts, $content){ | |
remove_filter( 'the_content', 'do_shortcode', 11 ); | |
return '<code>'.$content.'</code>'; | |
add_filter( 'the_content', 'do_shortcode', 11 ); |
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
/******* IN wp-config.php add the following: ******/ | |
/* WSI HYBRIDAUTH SESSIONS HANDLING */ | |
define('WSI_PHP_SESSION', dirname(__FILE__) . '/phpsession'); | |
session_save_path(WSI_PHP_SESSION); | |
/******* wp-content/plugins/wordpress-social-inivtations/wp-social-invitations.php and wp-content/plugins/wordpress-social-inivtations/hybridauth/index.php add the following: ******/ | |
/* WSI HYBRIDAUTH SESSIONS HANDLING */ | |
session_save_path(WSI_PHP_SESSION); |
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 you have a States model and you want to create a simple dropdown in your views you can pass the array very easily doing: | |
**/ | |
public function create() | |
{ | |
// first parameter is option label and second the option value | |
$states = State::lists('state', 'id'); | |
return View::make('anuncios.create', compact('states')); | |
} |
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
/** | |
* As many of you know after Poodle was released sslv3 was deactivated all over the internet and new problems arises | |
* when ciphers mismatch. If you get with wp_remote_ errors like: routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure | |
* routines:SSL3_READ_BYTES:sslv3 alert handshake failure or Cannot communicate securely with peer: no common encryption algorithm(s). | |
* Try to add the following action to modify curl. | |
**/ | |
add_action( 'http_api_curl', 'timersys_api_curl', 10, 3 ); | |
function timersys_api_curl(&$handle, $args, $url){ |
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
# Apache config | |
<FilesMatch ".(eot|ttf|otf|woff)"> | |
Header set Access-Control-Allow-Origin "*" | |
</FilesMatch> |
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
// hook to wsi bp screen | |
add_action('wsi/bp/screen_one' , 'attach_my_screen'); | |
function attach_my_screen() { | |
// hook to bp template | |
add_action( 'bp_template_content' , 'bp_template_content_func',9 ); | |
} | |
// My actual text | |
function bp_template_content_func() { | |
echo "My content goes here"; | |
} |