This page is created for WordPress Theme Demo Bar plugin.
There are 2 functions available :
Please read ” Using shortcode ” first to understand this page better.
Allows you to output theme info in template files instead of using shortcode in post. It accepts argument in strings and works exactly like the shortcode . Introduced in version 1.4.
<?php if ( function_exists ( 'wptdb_output' ) ) { wptdb_output($args); } ?> |
theme
(string) The theme’s folder name. Must be set.
format
(string) Format id. Default format will be used if you give an invalid format id.
get
(string) Get single info instead of using format.
Valid values : All available tags
autop
(string) Auto wrap the content with HTML paragraph <p> tag
echo
(string) Show the result or keep it in a variable. Default is true.
Display format id of 1
<?php if ( function_exists ( 'wptdb_output' ) ) { wptdb_output( 'theme=my-theme-folder-name&format=1' ); } ?> |
Display number of previews (inline)
Lunated theme has <?php if ( function_exists ( 'wptdb_output' ) ) { wptdb_output( 'theme=lunated&get=hits&autop=false' ); } ?> previews in total. |
Assign to variable
<?php if ( function_exists ( 'wptdb_output' ) ) { $stored = wptdb_output( 'theme=lunated&get=today&echo=0' ); echo $stored; } ?> |
Argument in array form
<?php if ( function_exists ( 'wptdb_output' ) ) { $stored = wptdb_output( array( 'theme' => 'lunated', 'get' => 'today', 'echo' => '0', ) ); echo $stored; } ?> |
Allows you to display a drop-down menu (<select>) for visitors to choose and preview your non-private themes. Introduced in version 1.5
<?php if ( function_exists ( 'wptdb_list_themes' ) ) { wptdb_list_themes($args); } ?> |
style
(string) Type of output. Default is “option” which output <option> to be used with <select>. Valid values:
hierarchical
(string) Show parent-child relationship. Default is true. Valid values:
orderby
(string) Sort themes by wordpress default method or by number of previews. Valid values:
order
(string) Sort order for themes (either ascending or descending). Default is asc. Valid values:
show_hits
(string) Show number of previews beside theme name in a bracket. Default is false. Valid values:
echo
(string) Show the result or keep it in a variable. Default is true.
Display drop-down menu using default settings
<?php if ( function_exists ( 'wptdb_list_themes' ) ) { echo '<select name="">'; wptdb_list_themes(); echo '</select>'; } ?> |
Display drop-down menu , sort the themes by number of previews in descending order
<?php if ( function_exists ( 'wptdb_list_themes' ) ) { echo '<select name="">'; wptdb_list_themes( 'orderby=hits&order=desc' ); echo '</select>'; } ?> |
Display drop-down menu with number of previews shown beside the theme name
<?php if ( function_exists ( 'wptdb_list_themes' ) ) { echo '<select name="">'; wptdb_list_themes( 'show_hits=1' ); echo '</select>'; } ?> |
Argument in array form
<?php if ( function_exists ( 'wptdb_list_themes' ) ) { echo '<select name="">'; wptdb_list_themes( array( 'orderby' => 'hits', 'order' => 'desc', )); echo '</select>'; } ?> |
I am trying to figure out how I can use your plugin to create a theme demo bar like yours but with an additional drop down to change that themes styles. Can you let me know how to set something like this up. I would have like six themes and each one has anywhere between 5 and 8 css files. Any help would be greatly appreciated.