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 | |
/** | |
* WooCommerce Sale Flash | |
* Display money saved on a product, or the discount percentage | |
* Add this file to your theme folder to /woocommerce/loop and into /woocommerce/single (if wanted there too) | |
* Konrad Sroka - http://konradsroka.com | |
* | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; |
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 | |
// display member list filtered by profile fields | |
function member_list_by_profile_fields( $atts ) { | |
global $bp, $wpdb; | |
$atts = shortcode_atts( array( | |
'id' => '1', | |
'YOURFIELDNAME' => 'default-value' // this can be just a number! check in bp profile field settings with inspector tool ;) | |
), $atts, 'member_list_by_profile_fields' ); |
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
// Note: Sadly you need to make one hack into the DWQA plugin as they didn't want to add a new do_action at this place. | |
// I was a bit disappointed with that answer, however you need to add the do_action into the DWQA plugin yourself.. :-/ | |
// HOW TO MAKE THIS WORK: | |
// First add this whole PHP chunk to your theme's functions.php or into your custom plugin. | |
// Then copy this: do_action( 'kx_dwqa_add_comment' ); | |
// Go to file dw-question-answer/inc/actions.php to the function dwqa_comment_action_add() | |
// and paste it right after the ob_end_clean(); - in the next line. | |
// That's it, save and test ;) |
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
// tell myCRED to ignore waiting for a user to confirm their signup via BuddyPress | |
// cheers to @gabrielmerovingi for this neat 1-line-solution | |
add_filter( 'bp_core_signup_send_activation_key', '__return_false' ); |
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
// ---------------------------------------------------- | |
// Adding the placeholders in textfields of login form | |
// ---------------------------------------------------- | |
jQuery(document).ready(function($) { | |
$('#loginform input[type="text"]').attr('placeholder', 'Username'); | |
$('#loginform input[type="password"]').attr('placeholder', 'Password'); | |
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
// this is the action hook to add stuff above the content.. | |
add_action( 'bp_after_header', 'cc_add_above_content' ); | |
// this is the function to add stuff above the content.. | |
function cc_add_above_content() { | |
// first, add a wrapper around. | |
echo '<div style="margin: 10px 0;">'; |
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 | |
// Some Examples | |
// The following examples show how you can use the CC_Customizer class to generate the CSS for the frontend. | |
// First create a new Customizer_Frontend_CSS object. | |
$cc_customizer = new Customizer_Frontend_CSS(); | |
// Now we can start defining the styles we need for the frontend, | |
// based on the saved option values in the WP Customizer. |
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 small PHP class provides you some functions to build the frontend CSS from the WP Customizer Options. | |
* | |
* == Fight the PHP Noodles in your CSS! == | |
* As the resulting dynamic CSS of themes can look ugly, | |
* we thought about a sweet and short solution for this. | |
* | |
* == Better Readabilty == |