Skip to content

Instantly share code, notes, and snippets.

<?php
// Question
function your_theme_record_question_activity( $post_id ) {
$post = get_post($post_id);
$user_id = get_current_user_id();
if(function_exists('mycred_add')) {
if($post->post_status == 'private') {
mycred_add( 'new_question', $user_id, '-20', '%plural% for Ask a Question', $post_id, array( 'ref_type' => 'post' ) );
} else {
mycred_add( 'new_question', $user_id, '-10', '%plural% for Ask a Question', $post_id, array( 'ref_type' => 'post' ) );
@j4ckielord
j4ckielord / jquery.custom.js
Created March 18, 2014 09:21
On touch check
if( ('ontouchstart' in window) ){
$('.profile-links').bind('touchstart click', function(event) {
event.preventDefault();
event.stopPropagation();
$(this).toggleClass('open').children('ul').slideToggle(300);
});
$('#navigation .fa').bind('touchstart click', function(event) {
event.preventDefault();
event.stopPropagation();
@j4ckielord
j4ckielord / dw-feed-copyright-mark.php
Created March 14, 2014 09:54
DW Feed Copyright Mark
@j4ckielord
j4ckielord / dw-minimum-comment-length.php
Created March 14, 2014 09:52
DW Minimum Comment Length
<?php
/**
* Plugin Name: DW Minimum Comment Length
* Description: Set the minimum comment length and disapprove if it is too short.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
**/
@j4ckielord
j4ckielord / dw-post-views.php
Created March 14, 2014 09:50
DW Post Views Counter
<?php
/**
* Plugin Name: DW Post Views Counter
* Description: To track and display post views counter.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
*/
@j4ckielord
j4ckielord / dw-extra-user-fields.php
Created March 14, 2014 09:48
DW Extra User Fields
<?php
/**
* Plugin Name: DW Extra User Fields
* Description: Add extra fields to the user profile page.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
**/
@j4ckielord
j4ckielord / dw-post-content-link-replacement.php
Created March 14, 2014 09:46
W Post Content Link Replacement
<?php
/**
* Plugin Name: DW Post Content Link Replacement
* Description: Add target="_blank" and rel="nofollow" to links.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
**/
@j4ckielord
j4ckielord / dw-disable-auto-resize-images.php
Created March 14, 2014 09:39
DW Disable Auto-Resize Images
<?php
/**
* Plugin Name: DW Disable Auto-Resize Images
* Description: Disable WordPress’s Automatic Image Resize Function.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
*/
add_filter('jpeg_quality', function($arg){ return 100; });
@j4ckielord
j4ckielord / dw-rss-feeds-thumbnail.php
Last active August 29, 2015 13:57
DW Add Thumbnail to RSS Feeds
<?php
/**
* Plugin Name: DW Add Thumbnail to RSS Feeds
* Description: Add post thumbnail to RSS feed items.
* Version: 1.0
* Author: DesignWall
* Author URI: http://www.designwall.com/
* License: GPLv3 or later
**/
@j4ckielord
j4ckielord / dw-disable-comment-links.php
Created March 14, 2014 09:30
Disable links in comments