Exemplo n.º 1
0
    }
    if (isset($my_widget_num[$this_id])) {
        // See if the counter array has an entry for this sidebar
        $my_widget_num[$this_id]++;
    } else {
        // If not, create it starting with 1
        $my_widget_num[$this_id] = 1;
    }
    $class = 'class="widget-' . $my_widget_num[$this_id] . ' ';
    // Add a widget number class for additional styling options
    if ($my_widget_num[$this_id] == 1) {
        // If this is the first widget
        $class .= 'first ';
    } elseif ($my_widget_num[$this_id] == count($arr_registered_widgets[$this_id])) {
        // If this is the last widget
        $class .= 'last ';
    }
    $params[0]['before_widget'] = str_replace('class="', $class, $params[0]['before_widget']);
    // Insert our new classes into "before widget"
    return $params;
}
/*custom comments*/
function custom_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
Exemplo n.º 2
0
function cp_custom_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    switch ($comment->comment_type) {
        case 'pingback':
        case 'trackback':
            ?>
            <li class="pingback">
                    <?php 
            comment_author_link();
            ?>
            <?php 
            break;
        default:
            ?>

            <li <?php 
            comment_class();
            ?>
>
            
                <a name="comment-<?php 
            comment_ID();
            ?>
"></a>
            
                    <?php 
            if (get_comment_type() == 'comment') {
                ?>
            
                        <div class="avatar"><?php 
                commenter_avatar();
                ?>
</div>
            
                    <?php 
            }
            ?>
            
                <div class="comment-head">
            
                    <div class="user-meta">
            
                        <strong class="name"><?php 
            commenter_link();
            ?>
</strong> <?php 
            _e('on', APP_TD);
            ?>
            
                        <?php 
            if (get_comment_type() == 'comment') {
                ?>
            
                            <a class="comment-permalink" href="<?php 
                echo get_comment_link();
                ?>
"><?php 
                echo get_comment_date(get_option('date_format'));
                ?>
 @ <?php 
                echo get_comment_time(get_option('time_format'));
                ?>
</a> <?php 
                edit_comment_link(__('Edit', APP_TD), ' <span class="edit-link">(', ')</span>');
                ?>
            
                        <?php 
            }
            ?>
                    
                    </div> <!-- /user-meta -->
            
                </div> <!-- /comment-head -->
            
            
                <div class="comment-entry"  id="comment-<?php 
            comment_ID();
            ?>
">
            
                    <?php 
            comment_text();
            ?>
            
                    <?php 
            if ($comment->comment_approved == '0') {
                ?>
                    
                        <p class='unapproved'><?php 
                _e('Your comment is awaiting moderation.', APP_TD);
                ?>
</p>
            
                    <?php 
            }
            ?>
            
                    <div class="clr"></div>
            
                    <div class="reply">
            
                        <?php 
            comment_reply_link(array_merge($args, array('reply_text' => __('Reply', APP_TD), 'login_text' => __('Log in to reply.', APP_TD), 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="comment-reply-link">', 'after' => '</div>')));
            ?>
            
                    </div><!-- /reply -->
            
                </div><!-- /comment-entry -->
            
            <?php 
            break;
    }
}