Skip to content

Instantly share code, notes, and snippets.

@ajaydsouza
ajaydsouza / tptn_viewed_count.php
Created April 18, 2015 17:55
Top 10 - Don't track nextpage
<?php
/**
* Filter_tptn_viewed_count function.
*
* @param string $output Top 10 tracker script
* @return string Filtered tracker script
*/
function filter_tptn_viewed_count( $output ) {
global $wp_query;
@ajaydsouza
ajaydsouza / top-10-grid.css
Last active August 29, 2015 14:18
Top 10: 2x Grid
.tptn_title {
float: left;
clear: left!important;
}
.tptn_thumb {
align: center!important;
}
.tptn_posts,
.tptn_posts_daily {
margin-bottom: 20px;
@ajaydsouza
ajaydsouza / tptn_display_formatted_count.php
Last active July 22, 2017 22:11
Top 10 - tptn_list_count filter examples
<?php
/**
* Display the formatted list count.
*
* Add this code to your theme's functions.php file.
*
* @param $string $tptn_list_count Formatted list count
*/
function tptn_display_formatted_count( $tptn_list_count, $sum_count, $result ) {
@ajaydsouza
ajaydsouza / timthumb-crp.php
Last active August 29, 2015 14:16
Timthumb in Contextual Related Posts & Top 10
<?php
/**
* Filter function to resize post thumbnail. Filters: crp_thumb_url.
*
* @since 1.8.4
*
* @param string $postimage
* @param string|int $thumb_width
* @param string|int $thumb_height
@ajaydsouza
ajaydsouza / crp-plugin-api-examples.php
Last active December 1, 2022 20:16
Contextual Related Posts plugin API examples
<?php
/*
* This example fetches the related posts for the current post ID and displays the output in a custom format restricted by the 'news' category
*
*/
if ( function_exists( 'get_crp_posts_id' ) ) {
global $post;
$scores = get_crp_posts_id( array(
'postid' => $post->ID,
@ajaydsouza
ajaydsouza / filter_tptn_view_counter_script_url.php
Last active September 4, 2016 11:45
Alternate Tracking script - Filter script URL in Top 10 v2.x
<?php
/**
* Use external display of counter.
*
* @since 2.3.0
*
* @param string $home_url
* @return string
*/
@ajaydsouza
ajaydsouza / FF-TempFile.md
Created September 19, 2014 06:44
Firefox: Delete Temp Files on Exit

Visit about:config

Create a New Boolean and set to TRUE

browser.helperApps.deleteTempFileOnExit

@ajaydsouza
ajaydsouza / git-svn-commands.sh
Created September 4, 2014 19:37
Handy Git and SVN commands
svn log -r 1:HEAD --limit 1 http://plugins.svn.wordpress.org/top-10
svn2git http://plugins.svn.wordpress.org/top-10 --revision 65307 --verbose --no-minimize-url
svn rm $( svn status | sed -e '/^!/!d' -e 's/^!//' )
svn add --force * --auto-props --parents --depth infinity -q
@ajaydsouza
ajaydsouza / crp-pinterest.css
Created September 4, 2014 17:26
CRP - Pinterest
.crp_related {
padding: 0;
}
.crp_related ul {
-webkit-column-gap: 10px;
-webkit-column-fill: auto;
-moz-column-gap: 10px;
-moz-column-fill: auto;
column-gap: 15px;
@ajaydsouza
ajaydsouza / get_bsearch_heatmap.php
Last active August 29, 2015 14:02
get_bsearch_heatmap example
<?php if function_exists( 'get_bsearch_heatmap' ) {
$args = array(
'daily' => FALSE,
'smallest' => '10', // Heatmap - Smallest Font Size
'largest' => '20', // Heatmap - Largest Font Size
'unit' => 'pt', // Heatmap - We'll use pt for font size
'cold' => 'ccc', // Heatmap - cold searches
'hot' => '000', // Heatmap - hot searches
'before' => '', // Heatmap - Display before each search term
'after' => '&nbsp;', // Heatmap - Display after each search term