netbozum
tr.link

Wordpress Functions Category

6 Mesajlar 721 Okunma
acebozum
tr.link

Sercans Sercans www.sercansevincer.com.tr Kullanıcı
  • Üyelik 26.01.2017
  • Yaş/Cinsiyet 31 / E
  • Meslek Wordpress Developer
  • Konum İstanbul Avrupa
  • Ad Soyad S** S**
  • Mesajlar 330
  • Beğeniler 100 / 63
  • Ticaret 0, (%0)
Merhaba arkadaşlar

Web sitem üzerinde kullanıcılara yazı girişi yaptırabiliyorum. Burada istediğim konu tam olarak şu kategori seçtirirken kullanıcıya sadece benim istediğim kategorileri görmesini bir türlü sağlayamadım?

Bir fikri düşüncesi olan varsa paylaşabilir mi?
 

 

googleasistan
reklam

Sercans Sercans www.sercansevincer.com.tr Kullanıcı
  • Üyelik 26.01.2017
  • Yaş/Cinsiyet 31 / E
  • Meslek Wordpress Developer
  • Konum İstanbul Avrupa
  • Ad Soyad S** S**
  • Mesajlar 330
  • Beğeniler 100 / 63
  • Ticaret 0, (%0)
güncel
 

 

wpuzman wpuzman WordPress Developer Kullanıcı
  • Üyelik 13.01.2017
  • Yaş/Cinsiyet 33 / E
  • Meslek Yazılım
  • Konum Trabzon
  • Ad Soyad B** M**
  • Mesajlar 2771
  • Beğeniler 293 / 949
  • Ticaret 33, (%100)
Yazı girişini eklenti ile mi yaptırıyorsunuz? Yoksa kendiniz mi yaptınız?
 

 

Sercans Sercans www.sercansevincer.com.tr Kullanıcı
  • Üyelik 26.01.2017
  • Yaş/Cinsiyet 31 / E
  • Meslek Wordpress Developer
  • Konum İstanbul Avrupa
  • Ad Soyad S** S**
  • Mesajlar 330
  • Beğeniler 100 / 63
  • Ticaret 0, (%0)
Kendim yaptım hocam bilimokur
 

 

wmaraci
wmaraci

wpuzman wpuzman WordPress Developer Kullanıcı
  • Üyelik 13.01.2017
  • Yaş/Cinsiyet 33 / E
  • Meslek Yazılım
  • Konum Trabzon
  • Ad Soyad B** M**
  • Mesajlar 2771
  • Beğeniler 293 / 949
  • Ticaret 33, (%100)
O zaman kategorileri çağırdığınız kodu atın. Düzeltelim.
 

 

Sercans Sercans www.sercansevincer.com.tr Kullanıcı
  • Üyelik 26.01.2017
  • Yaş/Cinsiyet 31 / E
  • Meslek Wordpress Developer
  • Konum İstanbul Avrupa
  • Ad Soyad S** S**
  • Mesajlar 330
  • Beğeniler 100 / 63
  • Ticaret 0, (%0)
/*
Template Name: Profil
*/
?>








Sorunu Sor























$categories = wp_dropdown_categories( array(
'orderby' => 'name',


) );

///

$istenmeyen_kategoriler = array('1','2');


foreach ( $categories as $category ) {
$kat_id = $category->term_id;
if(in_array($kat_id,$istenmeyen_kategoriler)){

}else{

echo '
';
}
unset($kat_id);
}
?>


















foreach ( $kategoriler as $kategori ) {
$kat[] = $kategori;
}
$args = array(
'post_title' => $_POST["baslik"],
'post_content' => $_POST["textarea"],
'post_status' => 'draft',
'post_type' => "post",
'post_category' => $kat
);
$new_post = wp_insert_post( $args );

if (
isset( $_POST['my_image_upload_nonce'] )
&& wp_verify_nonce( $_POST['my_image_upload_nonce'], 'my_image_upload' )
&& current_user_can( 'edit_post', $new_post )
) {
// The nonce was valid and the user has the capabilities, it is safe to continue.

// These files need to be included as dependencies when on the front end.
require_once( ABSPATH . 'wp-admin/includes/image.php' );
require_once( ABSPATH . 'wp-admin/includes/file.php' );
require_once( ABSPATH . 'wp-admin/includes/media.php' );

// Let WordPress handle the upload.
// Remember, 'my_image_upload' is the name of our file input in our form above.
$attachment_id = media_handle_upload( 'my_image_upload', $new_post );
set_post_thumbnail( $new_post, $attachment_id );
if ( is_wp_error( $attachment_id ) ) {
// There was an error uploading the image.
} else {
// The image was uploaded successfully!
}

} else {

// The security check failed, maybe show the user an error.
}

?>

 

 

wmaraci
wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al