• 04-09-2014, 00:34:04
    #1
    Merhaba arkadaşlar, ben satın aldığım temadaki bazı özelliklerin olmamasından dolayı temanın bileşenlerini kişiselleştirmeye çalıştım ancak css ve html değilde php olduğu için konuya yabancı kaldı bazı örnekler üzerinden anlamaya çalışım ama olmadı, şimdi size yapmaya çalıştığım 2 şeyi tek tek belirteceğim sizde bana tek tek yardım ederseniz süper olacak.

    Site adresi: http://www.klavyer.com/

    Soru 1;

    Şu şekilde bir bileşen var http://prntscr.com/4jejj2 1 büyük 4 küçük görselden oluşuyor (sayıyı bileşenlerden seçiyoruz) ben bunun büyük olanını silmek istedim css-html ve php özelliğini sildim ancak büyük görselin yerinde görünecek olan görsel hayalet oldu kategorideki 2. görselden başlıyor, şöyle: http://prntscr.com/4jekj5 (panelden 5 seçiyorum 4 görünüyor) kodlarda şu kısmı http://prntscr.com/4jemmw sildiğinde hata alıyorum ancak 0 yaptığımda ise 5 yazdıysam 5 görünüyor ve istediğim gibi oluyor ancak css bozuluyor nasıl silmem yada yerine ne yazmam gerekiyor.

    Bileşenlerdeki görünümü: http://prntscr.com/4jemdk

    Orjinal php içeriği;
    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list');
    
    function themeloy_register_widgets_grid_list() {
        register_widget('themeloy_recent_posts_widget_grid_list');
    }
    
    class themeloy_recent_posts_widget_grid_list extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    
        function __construct() {
            $widget_ops = array(
                'classname' => 'cat_recent_entries clearfix',
                'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
            );
            parent::__construct('custom-recent-posts-grid-list', __('Klavyer: Ana Sayfa Bileşeni NO:1', 'tl_back'), $widget_ops);
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    
        function widget($args, $instance) {
    
            extract($args);
    
            $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
        
            $show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    		
            if (!$number = absint($instance['number']))
                $number = 4;
    
            if (!$cats = $instance["cats"])
                $cats = '';
    
            // array to call recent posts.
    
            $themeloy_args = array(
                'showposts' => $number,
                'category__in' => $cats,
            );
    
            $themeloy_widget = null;
            $themeloy_widget = new WP_Query($themeloy_args);
    
            echo $before_widget;
    
            // Widget title
    
            echo $before_title;
            echo $instance["title"];
            echo $after_title;
    
            // Post list in widget
    		
    		 $blog_date_widget = of_get_option('blog_date_widget', 0); 
    		 $blog_comment_widget = of_get_option('blog_comment_widget', 0);
    
    
            $i = 0;
    
            while ($themeloy_widget->have_posts()) {
                $themeloy_widget->the_post();
                $i++;
    
                $thumb = themeloy_get_thumbnail(get_the_ID());
    
    
                if ($i == 1) {
    
                   	
    				$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-1.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '355x200');
    				}
                    ?>   
    
                    <div class="<?php if ($show_style_1 == true ) { echo "main-post-large-style";}else{echo " main-post-large";}?>">
                       <div class="image_review_wrapper">
    					<div id="klavyer-icon">
                        <a href="<?php the_permalink(); ?>"> 
                        <img class="main" src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"  />
    					<span class="goster-1"></span>
    					</div>
                        <?php echo themeloy_post_type(); ?>
                        </a>
                         <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                <?php 
    					if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){ ?>
                         <span class="review-wrap">
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"> </span>
                         </span>
                         </span>
                         <?php }else{?>
    					  <span class="review-wrap">
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                          </span>
    					 <?php }}else{?>
                          <span class="review-wrap">
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                          </span>
                        	<?php } ?>  
                        
                        </div> 
                   
                        <div class="feature-text">
    
                            <div class="post-title"><h3><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
    						<?php echo themeloy_short_title(70, get_the_title('')); ?>
                            </a></h3></div> 
                            <?php if($blog_date_widget == 0) { ?>
    										<?php } ?>
                                        <?php if($blog_comment_widget == 0) { ?>	
                                            <?php } ?>
                                            </p>
                      
                       
    					<?php if ($show_style_1 == true ) {echo themeloy_short_title(200, get_the_excerpt(''));}else{echo themeloy_short_title(300, get_the_excerpt(''));} ?>  
                     </div>
    				  
    				<?php
    						foreach((get_the_category()) as $category) {
    							$cikti = $category->slug;
    						}
    
    					?>
    				   <div class="isim-d-buyuk-<?php echo $cikti; ?>"></div><div class="isim-buyuk-<?php echo $cikti; ?>"></div>
    				   <div id="tarih-ana-ust">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce yazıldı'; ?></i>
    </div>
                    </div>
                    <?php if ($show_style_1 == true ) { echo '<div class="clear"></div>';}?>
                    
                    <div class="<?php if ($show_style_1 == true ) { echo "post-list-item-style";}else{echo " post-list-item";}?>">
    
                        <?php
    			}else {
    
                     			
    					
    				$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '177x100');
    				}
    					
                        
                        $date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
                        ?>
                        <div class="small-feature">
    					<div id="klavyer-icon">
                           <a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"  />
                            <?php echo themeloy_post_type(); ?>
    						<span class="goster-1-2"></span>
    					</div>
                            </a>
                            <div class="feature-text">
                                <div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    							<?php echo themeloy_short_title(50, get_the_title('')); ?>
                                </a></h4>
                                </div>
                                 <?php if($blog_date_widget == 0) { ?>
    									<?php } ?>
                                        	<?php if($blog_comment_widget == 0) { ?><?php } ?>
                         <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                 <?php if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){?>
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
                         </span>
                        <?php }else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
    						<?php }}else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                        	<?php } ?>
                            </div>
                           
    						<?php
    							foreach((get_the_category()) as $category) {
    								$cikti = $category->slug;
    							}
    
    						?>
    					   <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
                        </div>
    
    
                    <?php
    			};
                }
                ?>
    
            </div>  
          
            <?php
            wp_reset_query();
    
    
            echo $after_widget;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    
        function update($new_instance, $old_instance) {
            $instance = $old_instance;
            $instance['title'] = strip_tags($new_instance['title']);
            $instance['cats'] = $new_instance['cats'];
            $instance['number'] = absint($new_instance['number']);
         	$instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    
            return $instance;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    
        function form($instance) {
            $title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
            $number = isset($instance['number']) ? absint($instance['number']) : 5;
            $show_style_1 = isset($instance['show_style_1']) ? (bool) $instance['show_style_1'] : false;
            ?>
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
                <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
            
            <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
                <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
                <label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
       <p>
                <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back'); ?> 
    
                    <?php
                    $categories = get_categories('hide_empty=0');
                    echo "<br/>";
                    foreach ($categories as $cat) {
                        $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
                        if (isset($instance['cats'])) {
                            foreach ($instance['cats'] as $cats) {
                                if ($cats == $cat->term_id) {
                                    $option = $option . ' checked="checked"';
                                }
                            }
                        }
                        $option .= ' value="' . $cat->term_id . '" />';
                        $option .= '&nbsp;';
                        $option .= $cat->cat_name;
                        $option .= '<br />';
                        echo $option;
                    }
                    ?>
                </label>
            </p>
    
            <?php
        }
    
    }
    ?>
    Düzenlediğim php içeriği;
    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list2');
    
    function themeloy_register_widgets_grid_list2() {
        register_widget('themeloy_recent_posts_widget_grid_list2');
    }
    
    class themeloy_recent_posts_widget_grid_list2 extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    
        function __construct() {
            $widget_ops = array(
                'classname' => 'cat_recent_entries clearfix',
                'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
            );
            parent::__construct('custom-recent-posts-grid-list2', __('Klavyer: Ana Sayfa Bileşeni NO:2 (Sade)', 'tl_back'), $widget_ops);
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    
        function widget($args, $instance) {
    
            extract($args);
    
            $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
        
            $show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    		
            if (!$number = absint($instance['number']))
                $number = 4;
    
            if (!$cats = $instance["cats"])
                $cats = '';
    
            // array to call recent posts.
    
            $themeloy_args = array(
                'showposts' => $number,
                'category__in' => $cats,
            );
    
            $themeloy_widget = null;
            $themeloy_widget = new WP_Query($themeloy_args);
    
            echo $before_widget;
    
            // Widget title
    
            echo $before_title;
            echo $instance["title"];
            echo $after_title;
    
            // Post list in widget
    
            $i = 0;
    
            while ($themeloy_widget->have_posts()) {
                $themeloy_widget->the_post();
                $i++;
    
                if ($i == 1) {
    
                    ?>   
    
                    <div class="<?php if ($show_style_1 == true ) { echo "post-list-item-style";}else{echo " post-list-item";}?>">
    
                        <?php
    			}else {
                    ?>   
    
                        <?php
    				$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '177x100');
    				}
    					
                        $date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
                        ?>
                        <div class="small-feature">
    					<div id="klavyer-icon">
                           <a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"  />
                            <?php echo themeloy_post_type(); ?>
    						<span class="goster-1-2"></span>
    					</div>
                            </a>
                            <div class="feature-text">
                                <div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    							<?php echo themeloy_short_title(50, get_the_title('')); ?>
                                </a></h4>
                                </div>
                                 <?php if($blog_date_widget == 0) { ?><?php } ?>
                                        	<?php if($blog_comment_widget == 0) { ?><?php } ?>
                         <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                 <?php if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){?>
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
                         </span>
                        <?php }else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
    						<?php }}else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                        	<?php } ?>
                            </div>
                           
    						<?php
    							foreach((get_the_category()) as $category) {
    								$cikti = $category->slug;
    							}
    
    						?>
    					   <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
                        </div>
    
    
                    <?php
    			};
                }
                ?>
    
            </div>  
          
            <?php
            wp_reset_query();
    
    
            echo $after_widget;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    
        function update($new_instance, $old_instance) {
            $instance = $old_instance;
            $instance['title'] = strip_tags($new_instance['title']);
            $instance['cats'] = $new_instance['cats'];
            $instance['number'] = absint($new_instance['number']);
    		$instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    
            return $instance;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    
        function form($instance) {
            $title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
            $number = isset($instance['number']) ? absint($instance['number']) : 5;
            ?>
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Bileşen başlığı:', 'tl_back'); ?></label>
                <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
            
            <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Görünecek içerik sayısı:', 'tl_back'); ?></label>
                <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    			
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
                <label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
       <p>
                <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Görünmesini istediğiniz kategorileri seçin:', 'tl_back'); ?> 
    
                    <?php
                    $categories = get_categories('hide_empty=0');
                    echo "<br/>";
                    foreach ($categories as $cat) {
                        $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
                        if (isset($instance['cats'])) {
                            foreach ($instance['cats'] as $cats) {
                                if ($cats == $cat->term_id) {
                                    $option = $option . ' checked="checked"';
                                }
                            }
                        }
                        $option .= ' value="' . $cat->term_id . '" />';
                        $option .= '&nbsp;';
                        $option .= $cat->cat_name;
                        $option .= '<br />';
                        echo $option;
                    }
                    ?>
                </label>
            </p>
    
            <?php
        }
    
    }
    ?>
    Soru 2;

    Sidebar da işaretlediğim kategorileri listeleyen bir bileşen var ve ben bu bileşeni işaretlediğim kategori yerine bulunulan yazı ile ilgili benzer yazıları listeleyecek şekilde olmasını istiyorum, yani bu bileşeni sadece yazı içinde kullanacağım ve o yazı ile ilgili yazıları gösterecek (benzer etiketteki yazılar yada buna ek aynı kategorideki yazılar olabilir ama sadece aynı kategorideki yazılar olmasın)

    Bileşen kodları:
    <?php
    add_action( 'widgets_init', 'themeloy_rec_register_widgets_2' );
    
    function themeloy_rec_register_widgets_2() {
    	register_widget( 'themeloy_rec_posts_widget_2' );
    }
    
    class themeloy_rec_posts_widget_2 extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    			
    	function __construct() {
        	$widget_ops = array(
    			'classname'   => 'rec', 
    			'description' => __('Seçtiğiniziz kategorideki yazıalrı tarih sırasına göre sidebarda büyük görsel ile gösterir.', 'tl_back')
    		);
        	parent::__construct('rec-recent-posts-2', __('Klavyer: Sidebarda büyük benzer yazılar', 'tl_back'), $widget_ops);
    	}
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    
    	function widget($args, $instance) {
            extract($args);
            $title = apply_filters('widget_title', empty($instance['title']) ? 'Recently Articles' : $instance['title'], $instance, $this->id_base);
            if (!$number = absint($instance['number']))
                $number = 6;
            if (!$cats = $instance["cats"])
                $cats = '';
    		 
    
            $post_cat_args = array(
                'showposts' => $number,
                'category__in' => $cats
    			
            );
    
            $post_cat_widget = null;
            $post_cat_widget = new WP_Query($post_cat_args);
    
    
            echo $before_widget;
    
    
            echo $before_title;
            echo $instance["title"];
            echo $after_title;
    
            // Post list in widget
    		echo '<div class="widget recent-posts">';
            echo '<ul class="ulpost">';
    
            while ($post_cat_widget->have_posts()) {
                $post_cat_widget->the_post();
                ?>
                <li>
    							<div class="yazi-tarih"><div class="yazi-tarih-ic">
    				<i class="icon-calendar"></i> 
    				<i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce yazıldı'; ?></i>
    				</div></div>
                    <?php
                   	$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-6.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '300x170');
    				}
    				
    				
                    echo '
    				<div id="klavyer-icon">
    				<a class="entry-thumb2 feature-link" href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '">
    				<img src="' . $url[0] . '" alt="' . get_the_title() . '" />
    				<span class="goster"></span>
    				 </a>
    				</div>
    				
    				
    				';
    				echo themeloy_post_type();
                    ?>
                 
                    <div class="ulpost_title">
                        <a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    					<?php echo themeloy_short_title(61, get_the_title('')); ?>
    					</a>
                        <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                 <?php if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){?>
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
                         </span>
                        <?php }else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
    						<?php }}else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                        	<?php } ?> 
    						
    						<?php
    							foreach((get_the_category()) as $category) {
    								$cikti = $category->slug;
    							}
    
    						?>
    					   <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    						
                    </div>
    
    
                </li>
                <?php
            }
    
            wp_reset_query();
    
            echo "</ul>\n";
    		echo "</div>\n";
            echo $after_widget;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    	
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['title'] = strip_tags($new_instance['title']);
            $instance['cats'] = $new_instance['cats'];
    		$instance['number'] = absint($new_instance['number']);
    	    
            return $instance;
    	}
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    	
    	function form( $instance ) {
    		$title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
    		$number = isset($instance['number']) ? absint($instance['number']) : 5;
    	
    ?>
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
            <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
                            
            <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
            <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>        
           
            
             <p>
                <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back');?> 
                
                    <?php
                       $categories=  get_categories('hide_empty=0');
                         echo "<br/>";
                         foreach ($categories as $cat) {
                        $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
                  
    			        if (isset($instance['cats'])) {
                            foreach ($instance['cats'] as $cats) {
                                if ($cats == $cat->term_id) {
                                    $option = $option . ' checked="checked"';
                                }
                            }
                        }
    			  
                        $option .= ' value="' . $cat->term_id . '" />';
                        $option .= '&nbsp;';
                        $option .= $cat->cat_name;
                        $option .= '<br />';
                        echo $option;
                    }
                        
                        ?>
                </label>
            </p>
            
    <?php
    	}
    }
    ?>
    Evet arkadaşlar yardımcı olanlara şimdiden çok teşekkürler.
  • 05-09-2014, 12:26:13
    #2
    Yok mu bu konuda bir bilgisi olan ?
  • 05-09-2014, 22:55:53
    #3
    İlk istediğiniz için;
    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list');
    
    function themeloy_register_widgets_grid_list() {
        register_widget('themeloy_recent_posts_widget_grid_list');
    }
    
    class themeloy_recent_posts_widget_grid_list extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Setup
    /*-----------------------------------------------------------------------------------*/
    
        function __construct() {
            $widget_ops = array(
                'classname' => 'cat_recent_entries clearfix',
                'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
            );
            parent::__construct('custom-recent-posts-grid-list', __('Klavyer: Ana Sayfa Bileşeni NO:1', 'tl_back'), $widget_ops);
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Display Widget
    /*-----------------------------------------------------------------------------------*/
    
        function widget($args, $instance) {
    
            extract($args);
    
            $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
        
            $show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    		
            if (!$number = absint($instance['number']))
                $number = 4;
    
            if (!$cats = $instance["cats"])
                $cats = '';
    
            // array to call recent posts.
    
            $themeloy_args = array(
                'showposts' => $number,
                'category__in' => $cats,
            );
    
            $themeloy_widget = null;
            $themeloy_widget = new WP_Query($themeloy_args);
    
            echo $before_widget;
    
            // Widget title
    
            echo $before_title;
            echo $instance["title"];
            echo $after_title;
    
            // Post list in widget
    		
    		 $blog_date_widget = of_get_option('blog_date_widget', 0); 
    		 $blog_comment_widget = of_get_option('blog_comment_widget', 0);
    
    
            $i = 0;
    
            while ($themeloy_widget->have_posts()) {
                $themeloy_widget->the_post();
                $i++;
    
    				$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '177x100');
    				}
    					
                        
                        $date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
                        ?>
                        <div class="small-feature">
    					<div id="klavyer-icon">
                           <a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"  />
                            <?php echo themeloy_post_type(); ?>
    						<span class="goster-1-2"></span>
    					</div>
                            </a>
                            <div class="feature-text">
                                <div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    							<?php echo themeloy_short_title(50, get_the_title('')); ?>
                                </a></h4>
                                </div>
                                 <?php if($blog_date_widget == 0) { ?>
    									<?php } ?>
                                        	<?php if($blog_comment_widget == 0) { ?><?php } ?>
                         <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                 <?php if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){?>
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
                         </span>
                        <?php }else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
    						<?php }}else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                        	<?php } ?>
                            </div>
                           
    						<?php
    							foreach((get_the_category()) as $category) {
    								$cikti = $category->slug;
    							}
    
    						?>
    					   <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
                        </div>
    
    
                    <?php
    
                }
                ?>
    
            </div>  
          
            <?php
            wp_reset_query();
    
    
            echo $after_widget;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Update Widget
    /*-----------------------------------------------------------------------------------*/
    
        function update($new_instance, $old_instance) {
            $instance = $old_instance;
            $instance['title'] = strip_tags($new_instance['title']);
            $instance['cats'] = $new_instance['cats'];
            $instance['number'] = absint($new_instance['number']);
         	$instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    
            return $instance;
        }
    
    /*-----------------------------------------------------------------------------------*/
    /*	Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    
        function form($instance) {
            $title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
            $number = isset($instance['number']) ? absint($instance['number']) : 5;
            $show_style_1 = isset($instance['show_style_1']) ? (bool) $instance['show_style_1'] : false;
            ?>
            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
                <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
            
            <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
                <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
                <label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
       <p>
                <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back'); ?> 
    
                    <?php
                    $categories = get_categories('hide_empty=0');
                    echo "<br/>";
                    foreach ($categories as $cat) {
                        $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
                        if (isset($instance['cats'])) {
                            foreach ($instance['cats'] as $cats) {
                                if ($cats == $cat->term_id) {
                                    $option = $option . ' checked="checked"';
                                }
                            }
                        }
                        $option .= ' value="' . $cat->term_id . '" />';
                        $option .= '&nbsp;';
                        $option .= $cat->cat_name;
                        $option .= '<br />';
                        echo $option;
                    }
                    ?>
                </label>
            </p>
    
            <?php
        }
    
    }
    ?>
    2. istediğiniz widget için functions.php'nize şu kodları ekleyin;

    class Yazi_ici_Benzer_Yazilar extends WP_Widget {
    
    	function __construct() {
    		parent::__construct(
    			'yazi_ici_benzer_yazilar',
    			'Yazı içinde benzer yazılar',
    			array( 'description' => 'Yazı sayfasında benzer yazıları gösterir.(Etikete göre)', )
    		);
    	}
    
    	public function widget( $args, $instance ) {
    		global $post;
    		$tags = wp_get_post_tags($post->ID);
    		if(is_single() && $tags){
    			$title = apply_filters( 'widget_title', $instance['title'] );
    			$tag_ids = array();
    			foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
    			
    			$args = array(
    				'tag__in' => $tag_ids,
    				'post__not_in' => array($post->ID),
    				'showposts' => 4 // kaç tane gösterilsin
    			);
    
    			echo $args['before_widget'];
    			if ( ! empty( $title ) ) {
    				echo $args['before_title'] . $title . $args['after_title'];
    			}
    
    			echo '<div class="widget recent-posts">';
            	echo '<ul class="ulpost">';
    
    			$my_query = new wp_query($args);
    			if( $my_query->have_posts() ) {
    				while ($my_query->have_posts()) {
    					$my_query->the_post();
    				?>
    					<li>
    							<div class="yazi-tarih"><div class="yazi-tarih-ic">
    				<i class="icon-calendar"></i> 
    				<i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce yazıldı'; ?></i>
    				</div></div>
                    <?php
                   	$thumb = get_post_thumbnail_id(get_the_ID());
                    if (!$thumb) {
                        $url[0] = get_template_directory_uri() . '/img/demo/dum-6.jpg';
                    }else{
    					 $url = wp_get_attachment_image_src( $thumb , '300x170');
    				}
    				
    				
                    echo '
    				<div id="klavyer-icon">
    				<a class="entry-thumb2 feature-link" href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '">
    				<img src="' . $url[0] . '" alt="' . get_the_title() . '" />
    				<span class="goster"></span>
    				 </a>
    				</div>
    				
    				
    				';
    				echo themeloy_post_type();
                    ?>
                 
                    <div class="ulpost_title">
                        <a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    					<?php echo themeloy_short_title(61, get_the_title('')); ?>
    					</a>
                        <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    	                 <?php if (of_get_option('disable_review') == 0){
    						if($enable_review[0] == 1){?>
                         <span class="review-star">
                              <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
                         </span>
                        <?php }else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
    						<?php }}else{?>
    						 <span class="review-star-none">
                              <span class="review-star-inline-none"></span>
                         </span>
                        	<?php } ?> 
    						
    						<?php
    							foreach((get_the_category()) as $category) {
    								$cikti = $category->slug;
    							}
    
    						?>
    					   <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    						
                    </div>
    
    
                </li>
    				<?php
    				}
    				wp_reset_query();
    
    		        echo "</ul>\n";
    				echo "</div>\n";
    			}
    			 
    			echo $args['after_widget'];
    		}
    	}
    
    	public function form( $instance ) {
    		if ( isset( $instance[ 'title' ] ) ) {
    			$title = $instance[ 'title' ];
    		}
    		else {
    			$title = __( 'New title', 'text_domain' );
    		}
    		?>
    		<p>
    		<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 
    		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
    		</p>
    		<?php 
    	}
    
    	public function update( $new_instance, $old_instance ) {
    		$instance = array();
    		$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
    
    		return $instance;
    	}
    
    } 
    
    add_action( 'widgets_init', function(){
    	register_widget( 'Yazi_ici_Benzer_Yazilar' );
    });
  • 06-09-2014, 04:17:41
    #4
    jebias adlı üyeden alıntı: mesajı görüntüle
    İlk istediğiniz için;


    2. istediğiniz widget için functions.php'nize şu kodları ekleyin;

    Hocam 1. yaptığımda şöyle oluyor, css kayboluyor: http://prntscr.com/4k330h
    2. yaptığımda hata alıyorum, bileşen dosyasının içerisine sadece verdiğiniz kodu ekliyorum ve şu hatayı alıyorum "Parse error: syntax error, unexpected '}' in /*/public_html/wp-content/themes/themerush/inc/widget/recently-post-categories-2.php on line 98" 98. satırda ise şu var "}" 90-110 satır arası şöyle
     ?>
                      <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
                       
                    </div>
     
     
                </li>
                <?php
                }
                wp_reset_query();
     
                  echo "</ul>\n";
                echo "</div>\n";
             }
               
             echo $args['after_widget'];
          }
       }
     
       public function form( $instance ) {
          if ( isset( $instance[ 'title' ] ) ) {

    Hocam şu an var olan yanı için sidebat kısmında sadece benzer yazıları göstermek isityorum yanlış anlaşılma olmasın.

    http://www.klavyer.com/galaxy-note-4-ve-note-3-boyutlari.html
  • 06-09-2014, 08:47:24
    #5
    @SkyGhostAir;

    1.si için;
    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list');
    *
    function themeloy_register_widgets_grid_list() {
    ****register_widget('themeloy_recent_posts_widget_grid_list');
    }
    *
    class themeloy_recent_posts_widget_grid_list extends WP_Widget {
    *
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
    *
    ****function __construct() {
    ********$widget_ops = array(
    ************'classname' => 'cat_recent_entries clearfix',
    ************'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
    ********);
    ********parent::__construct('custom-recent-posts-grid-list', __('Klavyer: Ana Sayfa Bileşeni NO:1', 'tl_back'), $widget_ops);
    ****}
    *
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
    *
    ****function widget($args, $instance) {
    *
    ********extract($args);
    *
    ********$title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
    *****
    ********$show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    *******
    ********if (!$number = absint($instance['number']))
    ************$number = 4;
    *
    ********if (!$cats = $instance["cats"])
    ************$cats = '';
    *
    ********// array to call recent posts.
    *
    ********$themeloy_args = array(
    ************'showposts' => $number,
    ************'category__in' => $cats,
    ********);
    *
    ********$themeloy_widget = null;
    ********$themeloy_widget = new WP_Query($themeloy_args);
    *
    ********echo $before_widget;
    *
    ********// Widget title
    *
    ********echo $before_title;
    ********echo $instance["title"];
    ********echo $after_title;
    *
    ********// Post list in widget
    *******
    *******$blog_date_widget = of_get_option('blog_date_widget', 0); 
    *******$blog_comment_widget = of_get_option('blog_comment_widget', 0);
    *
    *
    ********$i = 0; ?>
    
    		<div class="post-list-item-style"> 
    		<?
    ********while ($themeloy_widget->have_posts()) {
    ************$themeloy_widget->the_post();
    ************$i++;
    *
    ************$thumb = get_post_thumbnail_id(get_the_ID());
    ****************if (!$thumb) {
    ********************$url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
    ****************}else{
    ****************$url = wp_get_attachment_image_src( $thumb , '177x100');
    ************}
    ****
    ********************$date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
    ********************?>
    ********************<div class="small-feature">
    ***************<div id="klavyer-icon">
    ***********************<a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"* />
    ************************<?php echo themeloy_post_type(); ?>
    ******************<span class="goster-1-2"></span>
    ***************</div>
    ************************</a>
    ************************<div class="feature-text">
    ****************************<div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    *********************<?php echo themeloy_short_title(50, get_the_title('')); ?>
    ****************************</a></h4>
    ****************************</div>
    *****************************<?php if($blog_date_widget == 0) { ?>
    ***************************<?php } ?>
    ***************************************<?php if($blog_comment_widget == 0) { ?><?php } ?>
    *********************<?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    ********************<?php if (of_get_option('disable_review') == 0){
    ******************if($enable_review[0] == 1){?>
    *********************<span class="review-star">
    **************************<span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
    *********************</span>
    ********************<?php }else{?>
    *******************<span class="review-star-none">
    **************************<span class="review-star-inline-none"></span>
    *********************</span>
    ******************<?php }}else{?>
    *******************<span class="review-star-none">
    **************************<span class="review-star-inline-none"></span>
    *********************</span>
    *********************<?php } ?>
    ************************</div>
    ************************
    ******************<?php
    *********************foreach((get_the_category()) as $category) {
    ************************$cikti = $category->slug;
    *********************}
    *
    ******************?>
    ******************<div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
    ********************</div>
    *
    *
    ****************<?php
    *
    ************}
    ************?>
    *
    ********</div>* 
    *******
    ********<?php
    ********wp_reset_query();
    *
    *
    ********echo $after_widget;
    ****}
    *
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
    *
    ****function update($new_instance, $old_instance) {
    ********$instance = $old_instance;
    ********$instance['title'] = strip_tags($new_instance['title']);
    ********$instance['cats'] = $new_instance['cats'];
    ********$instance['number'] = absint($new_instance['number']);
    ******$instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    *
    ********return $instance;
    ****}
    *
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    *
    ****function form($instance) {
    ********$title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
    ********$number = isset($instance['number']) ? absint($instance['number']) : 5;
    ********$show_style_1 = isset($instance['show_style_1']) ? (bool) $instance['show_style_1'] : false;
    ********?>
    ********<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
    ************<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    *
    *********
    ********<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
    ************<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    *
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
    ************<label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
    ***<p>
    ************<label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back'); ?> 
    *
    ****************<?php
    ****************$categories = get_categories('hide_empty=0');
    ****************echo "<br/>";
    ****************foreach ($categories as $cat) {
    ********************$option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
    ********************if (isset($instance['cats'])) {
    ************************foreach ($instance['cats'] as $cats) {
    ****************************if ($cats == $cat->term_id) {
    ********************************$option = $option . ' checked="checked"';
    ****************************}
    ************************}
    ********************}
    ********************$option .= ' value="' . $cat->term_id . '" />';
    ********************$option .= '&nbsp;';
    ********************$option .= $cat->cat_name;
    ********************$option .= '<br />';
    ********************echo $option;
    ****************}
    ****************?>
    ************</label>
    ********</p>
    *
    ********<?php
    ****}
    *
    }
    ?>
    2. kısımda bir sorun görünmüyor hocam, verdiğim kodu o dosyaya değilde functions.php'nin sonuna ekleyip deneyebilirmisin?
  • 06-09-2014, 09:12:23
    #6
    jebias adlı üyeden alıntı: mesajı görüntüle
    @SkyGhostAir;

    1.si için;

    2. kısımda bir sorun görünmüyor hocam, verdiğim kodu o dosyaya değilde functions.php'nin sonuna ekleyip deneyebilirmisin?
    Yok hocam olmadı,

    1. de yıldızlar sorun yaratıyorhepsini notepad+ ile boşluk yaptığımda işaretler sorun yaratıyor

    2. dediğiniz yere keleidğimde bileşende bir değişiklik olmuyor ancak, sitenin üstünde şu hatayı veriyor ve türkçe karakter bozulması oluyor sitede. "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /*/public_html/wp-content/themes/themerush/functions.php:602) in /**/public_html/wp-content/plugins/userpro/functions/api.php on line 554"

    Görsel: http://prntscr.com/4k4yf6
  • 06-09-2014, 09:34:15
    #7
    şu şekilde olucak hocam, neden yıldız ekledi anlamadım

    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list');
    
    function themeloy_register_widgets_grid_list() {
    register_widget('themeloy_recent_posts_widget_grid_list');
    }
    
    class themeloy_recent_posts_widget_grid_list extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
    
    function __construct() {
    $widget_ops = array(
    'classname' => 'cat_recent_entries clearfix',
    'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
    );
    parent::__construct('custom-recent-posts-grid-list', __('Klavyer: Ana Sayfa Bileşeni NO:1', 'tl_back'), $widget_ops);
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
    
    function widget($args, $instance) {
    
    extract($args);
    
    $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
    
    $show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    
    if (!$number = absint($instance['number']))
    $number = 4;
    
    if (!$cats = $instance["cats"])
    $cats = '';
    
    // array to call recent posts.
    
    $themeloy_args = array(
    'showposts' => $number,
    'category__in' => $cats,
    );
    
    $themeloy_widget = null;
    $themeloy_widget = new WP_Query($themeloy_args);
    
    echo $before_widget;
    
    // Widget title
    
    echo $before_title;
    echo $instance["title"];
    echo $after_title;
    
    // Post list in widget
    
    $blog_date_widget = of_get_option('blog_date_widget', 0); 
    $blog_comment_widget = of_get_option('blog_comment_widget', 0);
    
    
    $i = 0; ?>
    *
    ******<div class="post-list-item-style"> 
    ******<?
    while ($themeloy_widget->have_posts()) {
    $themeloy_widget->the_post();
    $i++;
    
    $thumb = get_post_thumbnail_id(get_the_ID());
    if (!$thumb) {
    $url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
    }else{
    $url = wp_get_attachment_image_src( $thumb , '177x100');
    }
    
    $date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
    ?>
    <div class="small-feature">
    <div id="klavyer-icon">
    <a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"* />
    <?php echo themeloy_post_type(); ?>
    <span class="goster-1-2"></span>
    </div>
    </a>
    <div class="feature-text">
    <div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    <?php echo themeloy_short_title(50, get_the_title('')); ?>
    </a></h4>
    </div>
    <?php if($blog_date_widget == 0) { ?>
    <?php } ?>
    <?php if($blog_comment_widget == 0) { ?><?php } ?>
    <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    <?php if (of_get_option('disable_review') == 0){
    if($enable_review[0] == 1){?>
    <span class="review-star">
    <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
    </span>
    <?php }else{?>
    <span class="review-star-none">
    <span class="review-star-inline-none"></span>
    </span>
    <?php }}else{?>
    <span class="review-star-none">
    <span class="review-star-inline-none"></span>
    </span>
    <?php } ?>
    </div>
    
    <?php
    foreach((get_the_category()) as $category) {
    $cikti = $category->slug;
    }
    
    ?>
    <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
    </div>
    
    
    <?php
    
    }
    ?>
    
    </div>* 
    
    <?php
    wp_reset_query();
    
    
    echo $after_widget;
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
    
    function update($new_instance, $old_instance) {
    $instance = $old_instance;
    $instance['title'] = strip_tags($new_instance['title']);
    $instance['cats'] = $new_instance['cats'];
    $instance['number'] = absint($new_instance['number']);
    $instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    
    return $instance;
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    
    function form($instance) {
    $title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
    $number = isset($instance['number']) ? absint($instance['number']) : 5;
    $show_style_1 = isset($instance['show_style_1']) ? (bool) $instance['show_style_1'] : false;
    ?>
    <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
    <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
    
    <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
    <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
    <label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
    <p>
    <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back'); ?> 
    
    <?php
    $categories = get_categories('hide_empty=0');
    echo "<br/>";
    foreach ($categories as $cat) {
    $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
    if (isset($instance['cats'])) {
    foreach ($instance['cats'] as $cats) {
    if ($cats == $cat->term_id) {
    $option = $option . ' checked="checked"';
    }
    }
    }
    $option .= ' value="' . $cat->term_id . '" />';
    $option .= '&nbsp;';
    $option .= $cat->cat_name;
    $option .= '<br />';
    echo $option;
    }
    ?>
    </label>
    </p>
    
    <?php
    }
    
    }
    ?>
    diğer sorun için, bana geçici bir ftp hesabı sağlayabilirmisiniz hocam? bu şekilde zor oluyor
  • 06-09-2014, 12:02:21
    #8
    jebias adlı üyeden alıntı: mesajı görüntüle
    şu şekilde olucak hocam, neden yıldız ekledi anlamadım

    <?php
    add_action('widgets_init', 'themeloy_register_widgets_grid_list');
    
    function themeloy_register_widgets_grid_list() {
    register_widget('themeloy_recent_posts_widget_grid_list');
    }
    
    class themeloy_recent_posts_widget_grid_list extends WP_Widget {
    
    /*-----------------------------------------------------------------------------------*/
    /* Widget Setup
    /*-----------------------------------------------------------------------------------*/
    
    function __construct() {
    $widget_ops = array(
    'classname' => 'cat_recent_entries clearfix',
    'description' => __('Ekran ızgara veya ön sayfada bir veya birden fazla kategoriden gelen son mesajları listeler.', 'tl_back')
    );
    parent::__construct('custom-recent-posts-grid-list', __('Klavyer: Ana Sayfa Bileşeni NO:1', 'tl_back'), $widget_ops);
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Display Widget
    /*-----------------------------------------------------------------------------------*/
    
    function widget($args, $instance) {
    
    extract($args);
    
    $title = apply_filters('widget_title', empty($instance['title']) ? 'Recent Posts' : $instance['title'], $instance, $this->id_base);
    
    $show_style_1 = isset($instance['show_style_1']) ? $instance['show_style_1'] : false;
    
    if (!$number = absint($instance['number']))
    $number = 4;
    
    if (!$cats = $instance["cats"])
    $cats = '';
    
    // array to call recent posts.
    
    $themeloy_args = array(
    'showposts' => $number,
    'category__in' => $cats,
    );
    
    $themeloy_widget = null;
    $themeloy_widget = new WP_Query($themeloy_args);
    
    echo $before_widget;
    
    // Widget title
    
    echo $before_title;
    echo $instance["title"];
    echo $after_title;
    
    // Post list in widget
    
    $blog_date_widget = of_get_option('blog_date_widget', 0); 
    $blog_comment_widget = of_get_option('blog_comment_widget', 0);
    
    
    $i = 0; ?>
    *
    ******<div class="post-list-item-style"> 
    ******<?
    while ($themeloy_widget->have_posts()) {
    $themeloy_widget->the_post();
    $i++;
    
    $thumb = get_post_thumbnail_id(get_the_ID());
    if (!$thumb) {
    $url[0] = get_template_directory_uri() . '/img/demo/dum-2.jpg';
    }else{
    $url = wp_get_attachment_image_src( $thumb , '177x100');
    }
    
    $date = '<span class="date">' . get_the_date('M d, Y') . '</span>';
    ?>
    <div class="small-feature">
    <div id="klavyer-icon">
    <a href="<?php the_permalink(); ?>" class="feature-link"><img src="<?php echo $url[0]; ?>" alt="<?php the_title(); ?>"* />
    <?php echo themeloy_post_type(); ?>
    <span class="goster-1-2"></span>
    </div>
    </a>
    <div class="feature-text">
    <div class="post-title"><h4><a class="title" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
    <?php echo themeloy_short_title(50, get_the_title('')); ?>
    </a></h4>
    </div>
    <?php if($blog_date_widget == 0) { ?>
    <?php } ?>
    <?php if($blog_comment_widget == 0) { ?><?php } ?>
    <?php $enable_review = get_post_custom_values('reviewthemeloy_checkbox', get_the_ID()); ?>
    <?php if (of_get_option('disable_review') == 0){
    if($enable_review[0] == 1){?>
    <span class="review-star">
    <span style="width:<?php echo themeloy_get_total_review(get_the_ID()); ?>%" class="review-star-inline"></span>
    </span>
    <?php }else{?>
    <span class="review-star-none">
    <span class="review-star-inline-none"></span>
    </span>
    <?php }}else{?>
    <span class="review-star-none">
    <span class="review-star-inline-none"></span>
    </span>
    <?php } ?>
    </div>
    
    <?php
    foreach((get_the_category()) as $category) {
    $cikti = $category->slug;
    }
    
    ?>
    <div class="isim-d-<?php echo $cikti; ?>"></div><div class="isim-<?php echo $cikti; ?>"></div>
    <div id="tarih-ana-alt">
    <i class="post-meta-ic"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce'; ?></i>
    </div>
    </div>
    
    
    <?php
    
    }
    ?>
    
    </div>* 
    
    <?php
    wp_reset_query();
    
    
    echo $after_widget;
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Update Widget
    /*-----------------------------------------------------------------------------------*/
    
    function update($new_instance, $old_instance) {
    $instance = $old_instance;
    $instance['title'] = strip_tags($new_instance['title']);
    $instance['cats'] = $new_instance['cats'];
    $instance['number'] = absint($new_instance['number']);
    $instance['show_style_1'] = (bool) $new_instance['show_style_1'];
    
    return $instance;
    }
    
    /*-----------------------------------------------------------------------------------*/
    /* Widget Settings (Displays the widget settings controls on the widget panel)
    /*-----------------------------------------------------------------------------------*/
    
    function form($instance) {
    $title = isset($instance['title']) ? esc_attr($instance['title']) : 'Recent Posts';
    $number = isset($instance['number']) ? absint($instance['number']) : 5;
    $show_style_1 = isset($instance['show_style_1']) ? (bool) $instance['show_style_1'] : false;
    ?>
    <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'tl_back'); ?></label>
    <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
    
    <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of posts to show:', 'tl_back'); ?></label>
    <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
    
    <p><input class="checkbox" type="checkbox" <?php checked($show_style_1); ?> id="<?php echo $this->get_field_id('show_style_1'); ?>" name="<?php echo $this->get_field_name('show_style_1'); ?>" />
    <label for="<?php echo $this->get_field_id('show_style_1'); ?>"><?php _e('Display post feature below main post?', 'tl_back'); ?></label></p>
    <p>
    <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Select categories to include in the recent posts list:', 'tl_back'); ?> 
    
    <?php
    $categories = get_categories('hide_empty=0');
    echo "<br/>";
    foreach ($categories as $cat) {
    $option = '<input type="checkbox" id="' . $this->get_field_id('cats') . '[]" name="' . $this->get_field_name('cats') . '[]"';
    if (isset($instance['cats'])) {
    foreach ($instance['cats'] as $cats) {
    if ($cats == $cat->term_id) {
    $option = $option . ' checked="checked"';
    }
    }
    }
    $option .= ' value="' . $cat->term_id . '" />';
    $option .= '&nbsp;';
    $option .= $cat->cat_name;
    $option .= '<br />';
    echo $option;
    }
    ?>
    </label>
    </p>
    
    <?php
    }
    
    }
    ?>
    diğer sorun için, bana geçici bir ftp hesabı sağlayabilirmisiniz hocam? bu şekilde zor oluyor
    Tamamdır hocam 1. sorun çözüldü, çok teşekkür ederim.

    FTP hesabı sağlayamam hocamda isterseniz skype ile görüşelim tw vereyim başlanın ? olur mu ? skype adresim muratdinc.md
  • 06-09-2014, 13:57:46
    #9
    SkyGhostAir adlı üyeden alıntı: mesajı görüntüle
    Tamamdır hocam 1. sorun çözüldü, çok teşekkür ederim.

    FTP hesabı sağlayamam hocamda isterseniz skype ile görüşelim tw vereyim başlanın ? olur mu ? skype adresim muratdinc.md
    Hocam TeamWiever olur ama ayın 10'unda olabilir. Wın modem kullanıyorum kotası doldu şuan hızı 12kb/s r10'a zor giriyorum Ayın 10'unda hızlanıcak tekrar, o zaman yardımcı olabilirim. Skype adresinizi ekledim.