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:
function wp_widget_search($args) {
extract($args);
$searchform_template = get_template_directory() . '/searchform.php';

echo $before_widget;

// Use current theme search form if it exists
if ( file_exists($searchform_template) ) {
include_once($searchform_template);
} else { ?>

echo $after_widget;
}

Bununla deÄŸiÅŸtirin:

PHP:
function wp_widget_search($args) {
extract($args);
$searchform_template = get_template_directory() . '/searchform.php';
$options = get_option('widget_search');
$title = apply_filters('widget_title', $options['title']);
if ( empty($title) )
$title = ' ';
echo $before_widget . $before_title . $title . $after_title;
echo '
<div>'
;

// Use current theme search form if it exists
if ( file_exists($searchform_template) ) {
include_once($searchform_template);
} else { ?&gt;

echo '</div>
'
;
echo $after_widget;
}

function wp_widget_search_control() {
$options = $newoptions = get_option('widget_search');
if ( $_POST["search-submit"] ) {
$newoptions['title'] = strip_tags(stripslashes($_POST["search-title"]));
}
if ( $options != $newoptions ) {
$options = $newoptions;
update_option('widget_search', $options);
}
$title = attribute_escape($options['title']);
?&gt;

}

Bu kodu bulun:

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

Altına bunu ekleyin :

PHP:
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 20 yazısı bulunuyor WebListele.


Yönetime bildir...

Yorum Ekle

Yorum ekleyebilmek için burdadan giriş yapabilirsiniz.

Kategoriler

 

ArÅŸiv

Site İçi Arama

Güncel Yorumlar

    Online Üyeler

     

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

    Sponsored

    Sayfa DeÄŸeri