?> <img src="<?php echo HW_SKIN::current()->get_skin_url('images/placeholder.png'); ?> " width="100px" style="width:150px; height:118px;"/> <?php } ?> </a> <h4><a href="<?php the_permalink(); ?> "> <?php if (method_exists('HW_Taxonomy_Post_List_widget', 'limit_str')) { echo HW_Taxonomy_Post_List_widget::limit_str(get_the_title()); } else { the_title(); } ?> </a></h4> <?php if (in_array('excerpt', $arrExlpodeFields)) { the_excerpt(); } ?> <?php //edit_post_link( __( 'Edit', 'hoangweb' ), '<span class="edit-link">', '</span>' ); ?> </li>
/** * constructor */ function HW_Taxonomy_Post_List_widget() { //Hoangweb Taxonomy Post List parent::WP_Widget(false, $name = "Truy xuất nội dung theo chuyên mục", array('description' => 'Hiển thị bài viết theo danh mục/taxonomy')); //you should check if whether this widget actived on frontend or neither maybe you can get widget data by get_option($this->option_name) if (!is_admin() && !is_active_widget(false, false, $this->id_base, true)) { return; } $this->setup_actions(); //instance skin if (class_exists('HW_SKIN')) { $this->skin = new HW_SKIN($this, plugin_dir_path(__FILE__), self::SKINS_FOLDER, 'hw-category-posts.php', 'skins'); //$this->skin->skin_name='hw-category-posts.php'; #/wp-contents/hw_yahooskype/yahooskype.php //$this->skin->skin_folder='wcp_hw_skins'; #create folder in /wp-contents/hw_yahooskype $this->skin->plugin_url = plugins_url('', __FILE__); $this->skin->enable_external_callback = false; $this->skin->create('pagination', '__paginations', 'hwtpl-pagination.php')->enable_external_callback = false; //create new skin for pagination //create scrollbar skins $this->skin->create('scrollbar', '__scrollbars', 'hwtpl-scrollbar.php')->enable_external_callback = false; $this->skin->enable_template_engine(); } self::$instance = $this; //save lastest instance of this widget //register widget features from HW_AWC if (class_exists('HW_AWC')) { /*HW_AWC::register_widget_feature($this,'grid_posts'); //depricated HW_AWC::register_widget_feature($this, 'saveconfig'); HW_AWC::register_widget_feature($this, 'fancybox');*/ } $this->hwtpl = new HW_Taxonomy_Post_List(); $this->hwtpl->localize_object_callback = array($this, '_set_localize_scripts_data'); }
/** * load more skins */ public function _hwrp_load_more_skins() { if (!wp_verify_nonce($_REQUEST['nonce'], "hwrp_load_more_skins")) { exit("No naughty business please"); } if (class_exists('HW_Taxonomy_Post_List_widget')) { $inst = HW_Taxonomy_Post_List_widget::get_instance(); //_print($inst->skin); } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { //$result = json_encode($result); } else { header("Location: " . $_SERVER["HTTP_REFERER"]); } die; }