Kategori | WordPress

Etiketler :

Arama widget’inin geliÅŸtirilmesi

Eklenme Tarihi : 05 August 2008

wordpress de fark ettiğim arama kutusunun kenarlığının olmadığı ve adının değiştirilemediğidir. Bunu düzenlemek için yapılacak sadece bir kaç editleme var.

wp-inludes/widgets.php dosyasını açalım;

Bu kodu bulun;

PHP:
  1. function wp_widget_search($args) {
  2. extract($args);
  3. $searchform_template = get_template_directory() . '/searchform.php';
  4.  
  5. echo $before_widget;
  6.  
  7. // Use current theme search form if it exists
  8. if ( file_exists($searchform_template) ) {
  9. include_once($searchform_template);
  10. } else { ?>
  11.  
  12. echo $after_widget;
  13. }

Bununla deÄŸiÅŸtirin:

PHP:
  1. function wp_widget_search($args) {
  2. extract($args);
  3. $searchform_template = get_template_directory() . '/searchform.php';
  4. $options = get_option('widget_search');
  5. $title = apply_filters('widget_title', $options['title']);
  6. if ( empty($title) )
  7. $title = ' ';
  8. echo $before_widget . $before_title . $title . $after_title;
  9. <div>';
  10.  
  11. // Use current theme search form if it exists
  12. if ( file_exists($searchform_template) ) {
  13. include_once($searchform_template);
  14. } else { ?&gt;
  15.  
  16. echo '</div>
  17. ';
  18. echo $after_widget;
  19. }
  20.  
  21. function wp_widget_search_control() {
  22. $options = $newoptions = get_option('widget_search');
  23. if ( $_POST["search-submit"] ) {
  24. $newoptions['title'] = strip_tags(stripslashes($_POST["search-title"]));
  25. }
  26. if ( $options != $newoptions ) {
  27. $options = $newoptions;
  28. update_option('widget_search', $options);
  29. }
  30. $title = attribute_escape($options['title']);
  31. ?&gt;
  32.  
  33. }

Bu kodu bulun:

PHP:
  1. wp_register_sidebar_widget('search', __('Search'), 'wp_widget_search', $widget_ops);

Altına bunu ekleyin :

PHP:
  1. wp_register_widget_control('search', __('Search'), 'wp_widget_search_control' );

Hepsi bu kadar, şimdi nasıl göründüğüne bakalım.

<p><br></p>
<p><br></p>

Bu konuyu ekleyen :

admin - Toplam 19 yazısı bulunuyor WebListele.


Yönetime bildir...

Yorum Ekle

Yorum ekleyebilmek için burdadan giriş yapabilirsiniz.

Kategoriler

 

ArÅŸiv

Güncel Yorumlar

    Online Üyeler

     

    August 2008
    M T W T F S S
    « Sep    
     123
    45678910
    11121314151617
    18192021222324
    25262728293031

    Sponsored

    Sayfa DeÄŸeri