Thứ Bảy, 3 tháng 8, 2013

Công cụ dành cho nhà phát triển wordpress - Thesis


Thesis

Thesis là gì ?

Nó không phải tên của 1 plugin, và nó cũng chẳng phải tên của một template. Plugin và template là hai thứ mà bất cứ ai "nhúng tay" vào wordpress cũng luôn sục sạo tìm kiếm.
Vậy thesis là gì? Nó là một công cụ dành cho nhà thiết kế wordpress. Lâu nay chúng ta thường nghĩ rằng để tạo ra plugin hay template, chúng ta sẽ phải code lại code rồi thử rồi lại sửa đến khi ưng thì thôi.
Ngày nay đã có thesis giúp bạn rút ngắn quá trình này, mọi việc sẽ trở nên trực quan hơn.

Thesis hợp với những ai ?

Thesis hợp với những người thiết kế wordpress chuyên nghiệp, bạn cần những kỹ năng sâu một chút về thiết kế wordpress để làm chủ công cụ này thuận lợi hơn. Cũng như phần lớn các mã nguồn mở thiết kế web khác, nó đòi hỏi bạn phải tường minh HTML, CSS, javascript, PHP, MySQL.

Thesis được bán với giá không rẽ so với mặt bằng thu nhập của dân Việt Nam. Hiện nay có 3 gói chính, dao động từ khoảng 100$ đến 200$, nói chung cần hơn 4 tr để bạn sở hữu sản phẩm này.
Trang chủ http://diythemes.com/
Tuy nhiên vì điều kiện tài chính hạn hẹp, bạn vẫn muốn tiềm hiểu và tham khảo thì có thể mạo hiểm down sản phẩm mà mình sưu tầm tại đây.
Bản Thesis 2.0:
  • http://adf.ly/TKuLH
  • http://j.gs/2cuZ
  • http://q.gs/4dMb1
Bạn có thể xem qua một số video để biết cách thức làm việc với thesis

...

thaotrinh
blog.bendoi.vn
Thứ Bảy, 29 tháng 6, 2013

Menu Dropdown categories wordpress

menu Dropdown categories
Mục đích như hình vẽ:

Chúng ta sẽ tạo menu DropDown vô số cấp!

menu Dropdown categories

Bước 1:

Tạo một trình đơn menu

Vào Giao diện -> Trình đơn -> đặt tên trình đơn (ví dụ “main menu” chẳng hặn)
-> đánh dấu tất cả chuyên mục -> thêm vào trình đơn -> dùng mouse sắp xếp theo thứ tự bạn muốn.
menu Dropdown categories

Bước 2:

Cấu hình giao diện

Copy code sau vào file functions.php
class nav_menu_css extends Walker {
var $db_fields = array( 'parent' => 'menu_item_parent', 'id' => 'db_id' );
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul>\n";
}
function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
/* Add active class */
if(in_array('current-menu-item', $classes)) {
$classes[] = 'active';
unset($classes['current-menu-item']);
}
/* Check for children */
$children = get_posts(array('post_type' => 'nav_menu_item', 'nopaging' => true, 'numberposts' => 1, 'meta_key' => '_menu_item_menu_item_parent', 'meta_value' => $item->ID));
if (!empty($children)) {
$classes[] = 'has-sub';
}
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
$id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
$output .= $indent . '<li' . $id . $value . $class_names .'>';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '<a'. $attributes .'>';
$item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
$item_output .= '</a>';
$item_output .= $args->after;
$output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
}
function end_el( &$output, $item, $depth = 0, $args = array() ) {
$output .= "</li>\n";
}
}
menu Dropdown categories

Bước 3:


Đặt nơi hiển thị menu

Sửa file Header.php
Tìm đoạn
<nav id="access" role="navigation">
…
</nav>
Bỏ tất cả trong này (nếu bạn muốn). Thay thế nó bằng đoạn:
<?php
wp_nav_menu(array(
'walker' => new nav_menu_css()
));
?>
menu Dropdown categories

Bước 4:


Tạo phong cách cho menu

Vào style.css chỉnh sửa phong cách đối tượng access nếu bạn muốn.
menu Dropdown categories

Nếu template bạn chưa có thì thêm đoạn này vào dùng tạm css có sẵn trong wordpress mặc định:

#access {
background: #222; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#252525, #0a0a0a);
background: -o-linear-gradient(#252525, #0a0a0a);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
background: -webkit-linear-gradient(#252525, #0a0a0a);
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
clear: both;
display: block;
float: left;
margin: 0 auto 6px;
width: 100%;
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
color: #eee;
display: block;
line-height: 3.333em;
padding: 0 1.2125em;
text-decoration: none;
}
#access ul ul {
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
margin: 0;
position: absolute;
top: 3.333em;
left: 0;
width: 188px;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #f9f9f9;
border-bottom: 1px dotted #ddd;
color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
width: 168px;
}
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
background: #efefef;
}
#access li:hover > a,
#access a:focus {
background: #f9f9f9; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
background: -o-linear-gradient(#f9f9f9, #e5e5e5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
color: #373737;
}
#access ul li:hover > ul {
display: block;
}
#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
font-weight: bold;
}

Ghi chú

Trên đây tôi giới thiệu khái quát cách làm menu Dropdown từ trình đơn chuyên mục, cách này áp dụng chung cho nhiều template.
Tùy vào template người ta sẽ đặt tên access bằng những tên khác nhau như nav, navigator … tùy ý cho nên bạn cũng cần biết đọc chút code, biết tìm trong Header.php đoạn đặt menu ngang tương tự:
<nav id="access" >
…
</nav>
là vùng nào hoặc ko có thì cũng biết cách thêm nó vào. Thường thì menu ngang dạng này được đặt phía cuối Header.php
menu Dropdown categories
menu Dropdown categories
Chúc bạn thành công!

tttj of bendoi.vn
Thứ Năm, 25 tháng 10, 2012

Plugin chấm điểm (gắn sao) cho bài viết bằng GD Star Rating


Description
GD Star Rating plugin allows you to set up rating and review system for posts, pages and comments in your blog. You can set many options for displaying the rating stars, and add widgets into the sidebars for displaying top ratings and other statistics generated by the plugin. Plugin includes advanced settings panels that will allow you to control many aspects of rating. Plugin also supports multi ratings along with thumbs based ratings. Plugin supports use of cache plugins and dynamic loading of data using ajax.

Supported languages: english, serbian, spanish, hindi, german, italian, french, ukrainian, belorussian, russian, polish
Installation

Minimal Requirements

  • PHP: 5.x.x
  • mySQL: 4.0, 4.1 or 5.x
  • WordPress: 2.8 or newer

Recommended Requirements

  • PHP: 5.2.x or newer
  • mySQL: 5.x
  • WordPress: 2.9 or newer

Theme Requirement

  • Header template must contain call for wp_head() function.
  • Footer template must contain call for wp_footer() function.

Upgrade Notice

  • When you upgrade to new version of the plugin, check widget settings and all the plugin settings.

Basic Installation

  • Plugin folder in the WordPress plugins folder must be gd-star-rating.
  • Upload gd-star-rating folder to the /wp-content/plugins/ directory
  • Activate the plugin through the 'Plugins' menu in WordPress
  • Check all the plugin and plugin widgets settings before using the plugin.

Advanced Installation

  • if you don't change location of wp-content folder, then you don't need to make any more changes.
  • if your wp-content folder is moved out of default WordPress location, then you must edit plugins config.php file and set value with exact location of wp-load.php file for global constant STARRATING_WPLOAD in line 8. Without this most of the features, including saving votes, will not work.

Using gdsr-config.php file

  • this file is used to set some of the constants plugin uses.
  • to use this file, you must move it file from gd-star-rating folder, one level up to plugins folder.
  • once you have moved it, make changes to it and it wll be loaded from the WordPress plugins root.
  • all settings in it can be added to wp-config.php. if you do that, you must not move the file from gd-star-rating.

WordPress MU & BuddyPress

  • Minimal version supported: 2.9
  • Support for WPMU is only partial, not everything works as it should be.
  • Plugin is not working with some BuddyPress specific features.

Browser Notice

  • Multi review feature on administration Post Edit page will not work properly with IE6 browsers.
Thanks: wordpress.org



Hẩy chọn pugin hợp với mã nguồn đang dùng