<?php
function gallerys() {
$theme = wp_get_theme();
if ( 'Remix' === $theme->name ) { $slug = ot_get_option('gallery_slug'); } else { $slug = 'gallery'; }
if ( 'Remix' === $theme->name ) { $gallery_title = ot_get_option('gallery_title'); } else { $gallery_title = 'Gallery'; }
$labels = array(
'name' => _x( $gallery_title, 'post type general name' ),
'singular_name' => _x( 'Gallery', 'post type singular name' ),
'add_new' => _x( 'Add New', 'gallery' ),
'add_new_item' => __( 'Add New Gallery' ),
'edit_item' => __( 'Edit Gallery' ),
'new_item' => __( 'New Gallery' ),
'all_items' => __( 'All Galleries' ),
'view_item' => __( 'View Gallery' ),
'search_items' => __( 'Search Galleries' ),
'not_found' => __( 'No Galleries found' ),
'not_found_in_trash' => __( 'No Galleries found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'gallery'
);
$args = array(
'labels' => $labels,
'description' => 'T20',
'public' => true,
'menu_position' => 10,
'menu_icon' => 'dashicons-format-gallery',
'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'comments' ),
'has_archive' => true,
'rewrite' => array( 'slug' => $slug )
);
register_post_type( 'gallery', $args );
if ( !function_exists( 'is_woocommerce' ) ) {
flush_rewrite_rules( false );
}
}
add_action( 'init', 'gallerys' );
add_filter( 'manage_edit-gallery_columns', 'my_edit_gallery_columns' ) ;
function my_edit_gallery_columns( $columns ) {
$columns = array(
'cb' => 'cb-select-all-1',
'cover' => __( 'Cover', 'T20' ),
'title' => __( 'Gallery Title', 'T20' ),
'date' => __( 'Date', 'T20' ),
'comments' => __( 'CM', 'T20' )
);
return $columns;
}
add_action( 'manage_gallery_posts_custom_column', 'my_manage_gallery_columns', 10, 2 );
function my_manage_gallery_columns( $column, $post_id ) {
global $post;
switch( $column ) {
case 'cover' :
printf( the_post_thumbnail('thumbnail') );
default :
break;
}
} Kücük Bir Kod Yardımı
3
●241
- 31-03-2015, 03:44:38Merhaba Arkadaşlar Bir Eklentim Var Temamda Resim Galerisi Eklentisi Bu Eklentide Resimler 2 Sutun Halinde Alt Alta Çıkıyor Ben Bunu Tek Sutun Halinde Yan Yana Göstermek İstiyorum Kodun Neresiyle Oynamam Gerekiyor Kod Aşağıdadır.
- 31-03-2015, 17:10:29Resimlerinizi siteye yükledikten sonra galeri oluşturuyorsunuz ve oluştururken yanda özellikleri ayarlayabilirsiniz. Böylece kodlarla uğraşmaya gerek kalmaz.Dusky adlı üyeden alıntı: mesajı görüntüle
- 31-03-2015, 19:20:05T20 Eklentisi Bu Eklenti İle Ekliyorum Resimleri Normal Galeri Oluşturduğun Zaman Temada Çıkmıyor O Şekilde Kodlanmış TemaSpeedTroller adlı üyeden alıntı: mesajı görüntüle
- 01-04-2015, 14:48:45Kimlik doğrulama veya yönetimden onay bekliyor.İyi çalışmalar hocam web sitenizin linkini pm olarak atarmısınız yardımcı olmaya çalışayım