Có phải bạn muốn thiết kế website tiết kiệm chi phí và thời gian mà còn chuẩn seo ?

Thiết kế website bằng wordpress

Với các gói 500k, 750k, 999k là bạn co ngay 1 website đẹp, chuẩn seo

Thiết kế website bằng wordpress

Với các gói 500k, 750k, 999k là bạn co ngay 1 website đẹp, chuẩn seo

Thiết kế website bằng wordpress

Với các gói 500k, 750k, 999k là bạn co ngay 1 website đẹp, chuẩn seo

Thiết kế website bằng wordpress

Với các gói 500k, 750k, 999k là bạn co ngay 1 website đẹp, chuẩn seo

Thiết kế website bằng wordpress

Với các gói 500k, 750k, 999k là bạn co ngay 1 website đẹp, chuẩn seo

11/29/13

add_image_size thêm kích thước ảnh mới trong wordpress

Tùy theo theme mà có kích thước ảnh khác nhau. Các ảnh này được resize theo 1 kích thước đã được khai báo trong file functions.php

Trong quá trình viết theme, bạn cần bổ sung 1 hình có kích thước mới ví dụ 152 X 92 pixels
    
Trong wordpress hỗ trợ tốt chúng ta trong phần này
            
    add_image_size('franchise-thumbnails', 152, 92, true);
    
=> Đây là hàm thêm kích thước ảnh mới với: tên, width, height, True hoặc false là drop ảnh hay không
            
Hàm này bạn chèn thêm trong file functions.php, lưu ý: Nó sẽ chỉ có hiệu lực khi bạn upload hình mới
        
Tham khảo: 

11/20/13

Sắp xếp post type trong admin wordpress

Mặc định bạn tạo ra 1 post type mới, danh sách các bài post sẽ sắp xếp theo 1 thứ tự mặc định (theo tiêu đề ASC). Bạn muốn tùy chỉnh việc sắp xếp này, có thể theo tiêu đề, theo ID, theo ngày

Tham khảo mẫu code dưới đâu. Code này được chèn trong file functions.php (hoặc kèm trong 1 plugin của bạn)

function set_custom_post_types_admin_order($wp_query) {
        if (is_admin()) {

            // Get the post type from the query
            $post_type = $wp_query->query['post_type'];

            if ($post_type == 'buy_a_franchise') {

                // 'orderby' value can be any column name
                //$wp_query->set('orderby', 'title');
                // 'order' value can be ASC or DESC
                $wp_query->set('order', 'DESC');
            }
        }
    }
    add_filter('pre_get_posts', 'set_custom_post_types_admin_order');

11/6/13

Wordpress Upload Image from front-end and get its url

function agp_process_woofile($files, $post_id, $caption){


  require_once(ABSPATH . "wp-admin" . '/includes/image.php');
  require_once(ABSPATH . "wp-admin" . '/includes/file.php');
  require_once(ABSPATH . "wp-admin" . '/includes/media.php');

    $attachment_id = media_handle_upload($files, $post_id);

 $attachment_url = wp_get_attachment_url($attachment_id);
  add_post_meta($post_id, '_file_paths', $attachment_url);

    $attachment_data = array(
    'ID' => $attachment_id,
    'post_excerpt' => $caption
  );

  wp_update_post($attachment_data);

  return $attachment_id;

} 
REF:http://stackoverflow.com/questions/17351348/upload-image-from-front-end-and-get-its-url