ThumbsUp Template Tag

From IThemes Codex
Jump to: navigation, search

You can manually include a ThumbsUp item manually if you know the Voting Group ID.

The arguments are as follows:

/**
* pb_thumbsup_display()
* Insert a voting group
*
*
* The defaults for the parameter $args are:
*		is_widget - If the code is being executed in a widget area (shrinks down the icon size) (default false)
*		show_stats - Whether to show the stats or not (default true)
*		group_id   - The ID of the voting group you would like to display.
*		thumb_width     - Default is 200. The Width dimension for displaying image thumbnails.
*		thumb_height   - Default is 200. The Height dimension for displaying image thumbnails.
*		video_max_height - Default is 300. The maximum height for an embedded video
*		video_max_width - Default is 300. The maximum width for an embedded video
*		show_item_title - Default is true. Whether to show the title for each item
*		show_group_title - Default is true. Whether to display the title for the voting group
*		show_group_desc - Default is false. Whether to display the description for the voting group
*		show_image_caption - Default is false. Whether to display the caption for an image
*		show_image_desc - Default is false. Whether to display the description for an image
*		orderby - Default is 'menu_order' - Which parameter to order by (rating, date, menu_order, rand)
*		order - Default is 'DESC'. The order to retrieve the items.
*
* @uses $wpdb
*
* @param array $args Elements that make up a voting group to insert.
* @return int|WP_Error WP_Error on failure.  HTML string on success.
*/

The following shows how to use the pb_thumbsup_display template tag to show a voting group of images.

<?php
$args = array(
	'group_id' => 2806,
	'thumb_width' => 500,
	'thumb_height' => 500,
	'show_item_title' => false,
	'show_image_caption' => true,
	'show_group_title' => false,
	'orderby' => 'rating',
	'order' => 'DESC'
);
$display = pb_thumbsup_display( $args );
if ( !is_wp_error( $display ) ) echo $display;
?>


← Back to ThumbsUp Codex Home

Personal tools
Namespaces
Variants
Actions
iThemes Codex
Codex Navigation
Toolbox