Aşşağıdaki Kod :
$kullanicilar = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
foreach ($kullanicilar as $kullanici) {
echo ''.$kullanici->user_nicename." ";
}
?>
$kullanicilar = $wpdb->get_results("SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
foreach ($kullanicilar as $kullanici) {
echo ''.$kullanici->user_nicename." ";
}
?>
/*
* Vefat Haberleri
*/
class uye_bileseni extends WP_Widget {
function __construct() {
$widget_options = array( 'description' => 'Dernek Üye Listesi widget olarak ekleyebilirsiniz.' );
parent::WP_Widget(false,'Dernek Üye Listesi', $widget_options );
}
function widget($args, $instance) {
extract($args);
$title = $instance['title'];
echo $before_widget;
?>
Son 5 Üyemiz
$kullanicilar = $wpdb->get_results("SELECT user_nicename,ID, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5");
foreach ($kullanicilar as $kullanici) {
echo '- '.$kullanici->user_nicename."
";
}
?>
wp_reset_query();
?>
echo $after_widget;
}
function update($new_instance, $old_instance) {
return $new_instance;
}
function form($instance) {
if(isset($instance['title'])) {
$title = $instance['title'];
}else {
$title = "";
}
?>
class="widefat" value="" name="get_field_name( 'title' ) ;?>" />
Üye Bileşeni Paneli Eklendi
}
}
register_widget( 'uye_bileseni' );
?>
Fatal error: Call to a member function get_users() on null in