Code to Display number of clicks
-
I am not the plugin author, however, I created the following code that others may find useful.
It will simply display the number/integer of how many clicks the link has received.
Place the following code in functions.php:function linker_return_count($atts) { $atts = shortcode_atts( array( 'id' => 'id' ), $atts ); $result = get_post_meta(esc_attr( $atts['id'] ), '_linker_count', true); return $result; } add_shortcode('linker_click_count_display', 'linker_return_count');
Then add this shortcode wherever you want the number to display:
[linker_click_count_display id="1234yournumberhere"]
Where 1234yournumberhere is replaced by the ID of the linker link you created. (Find this number by clicking “Edit” on your linker link and looking at the “?post=”)
Eg, for me my shortcode looks like:
[linker_click_count_display id="241"]
- The topic ‘Code to Display number of clicks’ is closed to new replies.