!function(t){t.fn.basictable=function(a){var e=function(a,e,n){a.children().each(function(){var a=t(this);if(“”!==a.html()&&” ”!==a.html()||n.showEmptyCells){for(var r=a.index(),i=””,s=0;s<e.length;s++){0!=s&&(i+=”: “);var o=e[s][r];null!=o&&(i+=o.text())}a.attr(“data-th”,i),n.contentWrap&&!a.children().hasClass(“bt-content”)&&a.wrapInner(‘<span class=”bt-content” />’)}else a.addClass(“bt-hide”)})},n=function(a,e){e.forceResponsive?null!==e.breakpoint&&t(window).width()<=e.breakpoint||null!==e.containerBreakpoint&&a.parent().width()<=e.containerBreakpoint?r(a,e):i(a,e):a.removeClass(“bt”).outerWidth()>a.parent().width()?r(a,e):i(a,e)},r=function(t,a){t.addClass(“lctablebt”),a.header||t.addClass(“bt–no-header”),a.tableWrap&&t.parent(“.bt-wrapper”).addClass(“active”)},i=function(t,a){t.removeClass(“bt bt–no-header”),a.tableWrap&&t.parent(“.bt-wrapper”).removeClass(“active”)},s=function(a,e){var n;a.removeClass(“bt bt–no-header”),a.find(“td”).removeAttr(“data-th”),e.tableWrap&&a.unwrap(),e.contentWrap&&(n=a,t.each(n.find(“td”),function(){var a=t(this),e=a.children(“.bt-content”).html();a.html(e)})),a.removeData(“basictable”)};this.each(function(){var o=t(this);if(0===o.length||o.data(“basictable”))return o.data(“basictable”)&&(“destroy”==a?s(o,o.data(“basictable”)):”start”===a?r(o,o.data(“basictable”)):”stop”===a?i(o,o.data(“basictable”)):n(o,o.data(“basictable”))),!1;var l=t.extend({},t.fn.basictable.defaults,a),b={breakpoint:l.breakpoint,containerBreakpoint:l.containerBreakpoint,contentWrap:l.contentWrap,forceResponsive:l.forceResponsive,noResize:l.noResize,tableWrap:l.tableWrap,showEmptyCells:l.showEmptyCells,header:l.header};null===b.breakpoint&&null===b.containerBreakpoint&&(b.breakpoint=568),o.data(“basictable”,b),function(a,n){var r=[];if(n.tableWrap&&a.wrap(‘<div class=”bt-wrapper”></div>’),n.header){var i=””;i=a.find(“thead tr th”).length?”thead th”:a.find(“tbody tr th”).length?”tbody tr th”:a.find(“th”).length?”tr:first th”:”tr:first td”,t.each(a.find(i),function(){var a=t(this),e=parseInt(a.attr(“colspan”),10)||1,n=a.closest(“tr”).index();r[n]||(r[n]=[]);for(var i=0;i<e;i++)r[n].push(a)})}t.each(a.find(“tbody tr”),function(){e(t(this),r,n)}),t.each(a.find(“tfoot tr”),function(){e(t(this),r,n)})}(o,o.data(“basictable”)),b.noResize||(n(o,o.data(“basictable”)),t(window).bind(“resize.basictable”,function(){var t;(t=o).data(“basictable”)&&n(t,t.data(“basictable”))}))})},t.fn.basictable.defaults={breakpoint:null,containerBreakpoint:null,contentWrap:!0,forceResponsive:!0,noResize:!1,tableWrap:!1,showEmptyCells:!1,header:!0}}(jQuery); // sử dụng trong content jQuery(document).ready(function(){ jQuery(‘body .text-contents .content-template table’).basictable({ breakpoint:992 }); }); File css @media (max-width:992px){.text-contents table.wp-block-table.lctablebt .tbody tr:first-child,table.lctablebt tbody ..
Archives : Tháng mười một-2018
Code: <?php if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); echo “<img src='{$image}’ alt=” />..
/** * Create a taxonomy * * @uses Inserts new taxonomy object into the list * @uses Adds query vars * * @param string Name of taxonomy object * @param array|string Name of the object type for the taxonomy object. * @param array|string Taxonomy arguments * @return null|WP_Error WP_Error if errors, otherwise null. */ function ..
/** * Registers a new post type * @uses $wp_post_types Inserts new post type object into the list * * @param string Post type key, must not exceed 20 characters * @param array|string See optional args description above. * @return object|WP_Error the registered post type object, or an error object */ function prefix_register_name() { $labels ..
$all_tags = get_tags(); $tag_id = array(); foreach( $all_tags as $tag ) { $tag_id[] = $tag->term_id; } $args = array( ‘numberposts’ => 5, ‘tag__in’ => $tag_id ); $posts = get_post..
add_filter( ‘woocommerce_product_tabs’, ‘flwoo_new_product_tab’ ); function flwoo_new_product_tab( $tabs ) { $tabs[‘description’][‘title’] = ‘Thông tin’; $tabs[‘tt_tab’] = array( ‘title’ => __( ‘Hướng dẫn thanh toán’, ‘woocommerce’ ), ‘priority’ => 20, ‘callback’ => ‘thanhtoan_tab_content’ ); $tabs[‘ctdt_tab’] = array( ‘title’ => __( ‘Chính sách điều kiện’, ‘woocommerce’ ), ‘priority’ => 21, ‘callback’ => ‘ctdt_tab_content’ ); return $tabs; } function ..
Code <?php $terms = get_the_terms( get_the_ID(), ‘taxonomy-slug’ ); // taxonomy-slug : chính là taxonomy cần lấy tags foreach ($terms as $key => $value): $termlink=get_term_link($value->slug, ‘taxonomy-slug’ ); ?> <li><a href=”<?=$termlink; ?>”><?=$value->name; ?></a></li> <?php endfore..
WordPress 5 sắp ra mắt vào trong tháng này.Từ wordpress 5 trở lên gutenberg đã tích hợp vào core của wordpress. Itheme cũ akasa sẽ không tương thích với Gutenberg mới hiện tại. Vì để khắc phục website vẫn chạy ổn định trên wordpress 5 sử dụng itheme cũ a e cần phải tắt chức ..
$args = array( ‘numberposts’ => -1, ‘post_type’ => ‘event’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘location’, ‘value’ => ‘Melbourne’, ‘compare’ => ‘LIKE’ ), array( ‘key’ => ‘location’, ‘value’ => ‘Sydney’, ‘compare’ => ‘LI..
Việc tránh sử dụng css quá nhiều gây ảnh hưởng tới trang a e nên sử dụng SVG để tối ưu tốc độ load ..
Phản hồi