Пример #1
0
 * Latest works shortcode
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_latest_works', 'shortcodes/list-works', 'core/portfolio');
$shortcode->setLoopAttributes(array('paged' => 1, 'post_type' => 'works'));
$shortcode->setAttributes(array('title' => __('Latest works', 'thb_text_domain'), 'num' => 3, 'thumb' => 0));
$shortcode->setExample('[thb_latest_works num="3"]');
$shortcode->setLabel(__('Latest works', 'thb_text_domain'));
$shortcode->setType(__('Content', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);
/**
 * Related posts
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_related_works', 'shortcodes/related-works', 'core/portfolio');
$shortcode->setLoopAttributes(array('paged' => 1));
$shortcode->setDynamicLoopAttributes('thb_related_posts_query');
$shortcode->setAttributes(array('title' => __('Related works', 'thb_text_domain'), 'num' => 3, 'thumb' => 0));
$shortcode->setExample('[thb_related_works num="3"]');
$shortcode->setLabel(__('Related works', 'thb_text_domain'));
$shortcode->setType(__('Content', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);
/**
 * Latest works widget
 * -----------------------------------------------------------------------------
 */
if (!class_exists('THB_LatestWorks_Widget')) {
    class THB_LatestWorks_Widget extends THB_Widget
    {
        /**
         * Constructor
Пример #2
0
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_related_posts', 'frontend/shortcodes/list-posts');
$shortcode->setLoopAttributes(array('paged' => 1));
$shortcode->setDynamicLoopAttributes('thb_related_posts_query');
$shortcode->setAttributes(array('title' => __('Related posts', 'thb_text_domain'), 'num' => 3, 'thumb' => 0, 'thumb_size' => 'micro'));
$shortcode->setExample('[thb_related_posts num="3"]');
$shortcode->setLabel(__('Related posts', 'thb_text_domain'));
$shortcode->setType(__('Content', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);
/**
 * Custom tag cloud
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_tag_cloud', 'frontend/shortcodes/tagcloud');
$shortcode->setAttributes(array('title' => __('Custom tag cloud', 'thb_text_domain'), 'num' => 0, 'tax' => 'post_tag', 'orderby' => 'name', 'order' => 'asc'));
$shortcode->setExample('[thb_tag_cloud]');
$shortcode->setLabel(__('Tag cloud', 'thb_text_domain'));
$shortcode->setType(__('Content', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);
/**
 * Single page
 * -----------------------------------------------------------------------------
 */
$shortcode = new THB_Shortcode('thb_page', 'frontend/shortcodes/single');
$shortcode->setLoopAttributes(array('posts_per_page' => 1, 'post_type' => 'page', 'page_id' => 0));
$shortcode->setAttributes(array('thumb' => 0));
$shortcode->setExample('[thb_page id="1"]');
$shortcode->setLabel(__('Page', 'thb_text_domain'));
$shortcode->setType(__('Content', 'thb_text_domain'));
$thb_theme->addShortcode($shortcode);