Пример #1
0
 * -----------------------------------------------------------------------------
 */
$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
         *