Teşekkürler paylaşımın için ama daha yolun çok başında bir tasarımcıyım, mesaja bileşenin php kodunu eklesem, verdiğiniz kodu nereye ekleyeceğimi gösterir misiniz.

görünüm:



kod:

## widget_tabs
add_action( 'widgets_init', 'tie_widget_tabs_box' );
function tie_widget_tabs_box(){
register_widget( 'tie_widget_tabs' );
}
class tie_widget_tabs extends WP_Widget {
function tie_widget_tabs() {
$widget_ops = array( 'description' => 'Most Popular, Recent, Comments, Tags' );
parent::__construct( 'widget_tabs', THEME_NAME .' - '.__( 'Tabs' , 'tie') , $widget_ops );
}
function widget( $args, $instance ) {

if( !empty( $instance['posts_order'] ) )
$posts_order = $instance['posts_order'];

if( empty($instance['posts_number']) || $instance['posts_number'] == ' ' || !is_numeric($instance['posts_number'])) $posts_number = 5;
else $posts_number = $instance['posts_number'];
?>






foreach ( $tabs_order_array as $tab ){

if( $tab == 'p' ) : ?>


    if( !empty($posts_order) && $posts_order == 'viewed' ) tie_most_viewed( $posts_number );
    else tie_popular_posts( $posts_number );
    ?>



if( $tab == 'r' ) : ?>






if( $tab == 'c' ) : ?>






if( $tab == 't' ) : ?>

8,'number' => 25,'orderby'=> 'count', 'order' => 'DESC' )); ?>

endif;
}
?>



}

function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['posts_number'] = strip_tags( $new_instance['posts_number'] );
$instance['posts_order'] = strip_tags( $new_instance['posts_order'] );
$instance['tabs_order'] = strip_tags( $new_instance['tabs_order'] );
return $instance;
}

function form( $instance ) {
$tie_random_id = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 5);

$id = explode("-", $this->get_field_id("widget_id"));
$widget_id = $id[1]. "-" .$tie_random_id;

$defaults = array( 'posts_order' => 'popular', 'posts_number' => 5 );
$instance = wp_parse_args( (array) $instance, $defaults );
?>

<script>
jQuery(document).ready(function($) {

jQuery( "#-order" ).sortable({
placeholder: "ui-state-highlight",
stop: function(event, ui) {
var data = "";

jQuery( "#-order li" ).each(function(i, el){
var p = jQuery( this ).data( 'tab' );
data += p+",";
});

jQuery("#-tabs-order").val(data.slice(0, -1));
}
});

});
</script>




'. __( "click Save button to be able to change the order of tabs ." , "tie").'

'?>



    >
    $tabs_order = 'p,r,c,t';
    if( !empty( $instance['tabs_order'] ) ){
    $tabs_order = $instance['tabs_order'];
    }
    $tabs_order_array = explode( ',' , $tabs_order );
    foreach ( $tabs_order_array as $tab ){

    if( $tab == 'p' )
    echo '
  • '. __ti( "Popular" ) .'
  • ';

    if( $tab == 'r' )
    echo '
  • '. __ti( "Recent" ) .'
  • ';

    if( $tab == 'c' )
    echo '
  • '. __ti( "Comments" ) .'
  • ';

    if( $tab == 't' )
    echo '
  • '. __ti( "Tags" ) .'
  • ';
    }
    ?>













}
}
?>

Ek Olarak: