Custom PHP Tag Placement
Following instructions are for advanced users only who have at least basic understanding of php code.
Here’s an example of how to add a comparison table to any theme file with a php tag:
<?php cmprzn_phptag($post->ID, ‘default’, array(‘us’ => array(‘bikes’)), 2); ?>
With this example we are telling the plugin to display comparison table with default template using keywords for the US visitor ‘bikes’ and select second column as the ‘best pick’
Here’s the full overview of the function:
cmprzn_phptag($post_id = 0, $use_tpl_id = FALSE, $phptag_kws = array(), $bestpick = FALSE, $echo = TRUE);
$post_id – obviously you must provide post id
$use_tpl_id – template id or leave FALSE to copy from post CompareZon settings or set to ‘default’
$phptag_kws – (optional) array with custom keywords; must be in following format: array(‘us’ => array(‘keyword one’, ‘keyword two’)); if not provided – post keywords will be used
$bestpick – (optional) same as setting value on edit post screen; by default template ‘best pick’ setting will be used
$echo – optionally echo or return contents