• 24-10-2016, 17:30:41
    #1
    Merhaba arkadaşlar, wordpress'te tourpacker temasını kullanıyorum ancak kodlayan kişi slug kısmını manuel olarak değiştirmeyi kapatmış.Kod kısmını atıyorum size görmeniz için:

    <?php
    
    add_action( 'init', 'register_tourpacker_Services' );
    function register_tourpacker_Services() {
        
        $labels = array( 
            'name' => __( 'Tour', 'tourpacker' ),
            'singular_name' => __( 'Tour', 'tourpacker' ),
            'add_new' => __( 'Add New Tour', 'tourpacker' ),
            'add_new_item' => __( 'Add New Tour', 'tourpacker' ),
            'edit_item' => __( 'Edit Tour', 'tourpacker' ),
            'new_item' => __( 'New Tour', 'tourpacker' ),
            'view_item' => __( 'View Tour', 'tourpacker' ),
            'search_items' => __( 'Search Tour', 'tourpacker' ),
            'not_found' => __( 'No Tour found', 'tourpacker' ),
            'not_found_in_trash' => __( 'No Tour found in Trash', 'tourpacker' ),
            'parent_item_colon' => __( 'Parent Tour:', 'tourpacker' ),
            'menu_name' => __( 'Tour', 'tourpacker' ),
        );
    
        $args = array( 
            'labels' => $labels,
            'hierarchical' => true,
            'description' => 'List Tour',
            'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'post-formats' ),
            'taxonomies' => array( 'Portfolio_category','skills' ),
            'public' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'menu_position' => 5,
            'menu_icon' => '', 
            'show_in_nav_menus' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'rewrite' => true,
            'capability_type' => 'post'
        );
    
        register_post_type( 'tour', $args );
    }
    
    add_action( 'init', 'create_Skills_hierarchical_taxonomy', 0 );
    
    //create a custom taxonomy name it Skillss for your posts
    
    function create_Skills_hierarchical_taxonomy() {
    
    // Add new taxonomy, make it hierarchical like categories
    //first do the translations part for GUI
    
      $labels = array(
        'name' => __( 'Skills', 'tourpacker' ),
        'singular_name' => __( 'Skills', 'tourpacker' ),
        'search_items' =>  __( 'Search Skills','tourpacker' ),
        'all_items' => __( 'All Skills','tourpacker' ),
        'parent_item' => __( 'Parent Skills','tourpacker' ),
        'parent_item_colon' => __( 'Parent Skills:','tourpacker' ),
        'edit_item' => __( 'Edit Skills','tourpacker' ), 
        'update_item' => __( 'Update Skills','tourpacker' ),
        'add_new_item' => __( 'Add New Skills','tourpacker' ),
        'new_item_name' => __( 'New Skills Name','tourpacker' ),
        'menu_name' => __( 'Skills','tourpacker' ),
      );     
    
    // Now register the taxonomy
    
      register_taxonomy('skills',array('tur-cesidi'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'tur-cesidi' ),
      ));
      
     
    
    }
    ?>
    tur-cesidi olarak yazdığım yer değişti sıkıntı yok.Fakat asıl sıkıntı register_post_type( 'tour', $args );. tour kısmını editlediğimde konulara erişilemiyor.

    Nasıl çözebilirim bu sorunu?
  • 24-10-2016, 17:36:48
    #2
    tour'u tur olarak değiştirdikten sonra Yönetici paneline girip kalıcı bağlantıları sıfırlayın ve değişiklikleri kaydedip o şekilde deneyin.
  • 24-10-2016, 17:44:20
    #3
    FSahin adlı üyeden alıntı: mesajı görüntüle
    tour'u tur olarak değiştirdikten sonra Yönetici paneline girip kalıcı bağlantıları sıfırlayın ve değişiklikleri kaydedip o şekilde deneyin.
    malesef olmadı yine.Kodlayan kişi nasıl yaptıysa oraya bi rewrite koymak çok mu zordu

    database'den wp-optionsdaki tour değişkenlerini değiştirmeme rağmen yine çalışmıyor.
  • 24-10-2016, 17:58:56
    #4
    PixelTasarim adlı üyeden alıntı: mesajı görüntüle
    malesef olmadı yine.Kodlayan kişi nasıl yaptıysa oraya bi rewrite koymak çok mu zordu

    database'den wp-optionsdaki tour değişkenlerini değiştirmeme rağmen yine çalışmıyor.
    Sitede yöneticilik açıp gönderirseniz bir kontrol edeyim hocam.
  • 25-10-2016, 09:11:43
    #5
    Çözemeyenler için sorunun çözümünü yazayım. Temayı yapan kişi slug kısmını rewrite yapmamış.Bunun için kendimiz en baştan yazıyoruz.Bu kodları düzenleyerek yapabilirsiniz. custom-post-type.php gibi bir dosyanın içinde olur genelde.

    add_action( 'init', 'register_tourpacker_Services' );
    function register_tourpacker_Services() {

    // set up the labels
    $labels = array(
    'name' => _x('Şehitlik Turları', 'post type general name'),
    'singular_name' => _x('Şehitlik Turları', 'post type singular name'),
    'add_new' => __('Add New'),
    'add_new_item' => __('Add New Job'),
    'edit_item' => __('Edit Job'),
    'new_item' => __('New Job'),
    'view_item' => __('View Job'),
    'search_items' => __('Search Jobs'),
    'not_found' => __('No Jobs found'),
    'not_found_in_trash' => __('No Jobs found in Trash'),
    'parent_item_colon' => '',
    'menu_name' => 'Şehitlik Turları'
    );
    //set up the rewrite rules
    $rewrite = array(
    'slug' => 'sehitlik-turlari'
    );
    //build the arguement array
    $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'query_var' => 'archives',
    'rewrite' => $rewrite,
    'capability_type' => 'post',
    'has_archive' => true,
    'hierarchical' => false,
    'menu_position' => null,
    'supports' => array('title','editor','author','comments')
    );
    register_post_type('Tour',$args);