Thứ Hai, 27 tháng 3, 2017

Sticky 1 phần từ chạy cố định khi trượt trang web

https://drive.google.com/file/d/0B1Cncuk8i9Z5aGlQQUw3aGZoa0E/view?usp=sharing

http://www.jqueryscript.net/demo/jQuery-Plugin-For-Fixed-Position-Elements-lockfixed/

Điều chỉnh sticky cố định:

$(document).ready(function () {
 $.lockfixed("#sidebar", {offset: {top: 20, bottom: 470} });
});

Thứ Năm, 23 tháng 3, 2017

Trang HTML cho phép chạy video youtube trực tiếp trên Facebook

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/youtube/javax.faces.resource/theme.css.xhtml?ln=primefaces-aristo" />
<title></title><meta name="title" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />
<meta itemprop="name" content="Doremon chú meo máy đến tử tương lai ✔ Bộ du lịch trong nhà" />
<meta itemprop="image" content="http://i.ytimg.com/vi/R5YCRPEmkTA/0.jpg" />
<meta property="og:video" content="https://www.youtube.com/v/R5YCRPEmkTA" />
<meta property="og:video:height" content="360" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video:width" content="640" />
<meta property="og:type" content="video" />
<meta property="og:title" />
<meta property="og:description" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@yt2fb" />
<meta name="twitter:title" content="Doremon chú meo máy đến tử tương lai ✔ Bộ du lịch trong nhà" />
<!-- <meta name="twitter:description" content="" /> -->
<meta name="twitter:description" />
<meta name="twitter:image" content="http://i.ytimg.com/vi/R5YCRPEmkTA/0.jpg" /></head><body>

<form id="home" name="home" method="post" action="/youtube/url_redirect" enctype="application/x-www-form-urlencoded">

<input type="hidden" name="home" value="home" />

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

<script type="text/javascript">

//<![CDATA[

$(document).ready(function () {

$(location).attr('href', 'https://www.youtube.com/watch?v=R5YCRPEmkTA');

});

//]]>

</script><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="7908985296043249661:2121313760421055535" autocomplete="off" />

</form></body>

</html>

Thứ Hai, 20 tháng 3, 2017

Plugin tạo tương tác trực tiếp trên hình ảnh trong BĐS

https://codecanyon.net/item/image-map-pro-for-cornerstone-interactive-image-map-builder/14396621?ref=nickys

Tiêu đề danh mục đã được loại bỏ Category

<span><?php echo '<h1 class="page-title">';single_cat_title();echo '</h1>'; ?></span>

Còn đối với các post type thì bạn có thể sử dụng đoạn bên dưới

<h1><?php post_type_archive_title(); ?></h1>

Thứ Tư, 15 tháng 3, 2017

Bài viết liên quan cho wordpress



<?php
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'showposts'=>4,
'ignore_sticky_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
echo '<div class="label_splienquan"><h4><span>Bài viết liên quan</span></h4></div>';
echo '<div class="row sanpham_lienquan">';
echo '<div class="col-md-12">';
while ($my_query->have_posts()) :
$my_query->the_post();
?>
<div class="list_sanpham_lienquan col-md-3 col-sm-6 col-xs-12">
<div class="new-img">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(150, 150)); ?>
</a>
</div>
<div class="item-list">
<h4><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?></a>
</h4>
<div class="thongtinsp_lienquan"> <!-- Thông tin sản phẩm -->
<div class="gia_sp_lienquan">Giá: <span><?php the_field('gia_duan'); ?></span></div>
</div>
</div>
</div>
<?php endwhile ; wp_reset_query() ;?>
</div>
<?php }
}
?>

Thứ Năm, 9 tháng 3, 2017

Thay thế jQuery mặc định WordPress với Thư viện Google

Đưa đoạn dưới vào trong function

//Making jQuery Google API
function modify_jquery() {
 if (!is_admin()) {
  // comment out the next two lines to load the local copy of jQuery
  wp_deregister_script('jquery');
  wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js', false, '1.8.1');
  wp_enqueue_script('jquery');
 }
}
add_action('init', 'modify_jquery');

Thứ Sáu, 3 tháng 3, 2017