• this is what I added in my functions.php to be able to get the number of hits this post got as a shortcode, was missing in the plugin

    Have fun with it, Heli

    // Ajax View Counter of Tbl top_ten
    function view_hits_function($atts , $content=null) {
    	global $wpdb;
    	$table_name = $wpdb->prefix . "top_ten";
    	// echo $table_name;
    	$myid = get_the_ID();
    	// echo 'the ID ' .$myid;
    
            return ($wpdb->get_var($wpdb->prepare("SELECT cntaccess FROM $table_name WHERE postnumber = '$myid'")));
    
            }
    add_shortcode("view_hits","view_hits_function");

    http://wordpress.org/extend/plugins/top-10/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Top 10] added [view_hits] shortcode for Top10’ is closed to new replies.