示例#1
0
function cws_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>

			<li class="comment" id="div-comment-<?php 
    comment_ID();
    ?>
">
				<div class="comment-body">
					<?php 
    echo get_avatar($comment, '47');
    ?>
					<div class="comment-text">
						<div class="comment-author"><?php 
    printf(__('%s', 'happykids'), get_comment_author_link());
    ?>
</div>
						<div class="comment-entry"><?php 
    echo strip_tags(get_comment_text());
    ?>
</div>
						<div class="comment-meta">

						<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'reply_text' => '<span class="color_accent">' . multitranslate(__('Reply', 'happykids'), "_comments_reply", false) . '</span>', 'max_depth' => $args['max_depth'])));
    ?>
						<?php 
    edit_comment_link('<span class="comment_edit_span">' . multitranslate(__('Edit', 'happykids'), "_comments_edit", false) . '</span>');
    ?>

						<?php 
    printf(__('%1$s at %2$s', 'happykids'), get_comment_date(), get_comment_time());
    ?>
						</div><!--/ comment-meta -->
					</div><!--/ comment-text -->
					<div class="kids_clear"></div>
				</div>
<?php 
}
示例#2
0
				<div class="post_cats">
					<p><span><?php 
        multitranslate(__('Category', 'happykids'), 'cws_post_under_cat');
        ?>
:</span><?php 
        echo trim($output, $separator);
        ?>
</p>
				</div><!--/ post-cats -->

			<?php 
        if ($tag_out) {
            ?>
				<div class="post_tags">
					<p><span><?php 
            multitranslate(__('Tags:', 'happykids'), 'cws_post_under_tags');
            ?>
</span>
						<?php 
            echo trim($tag_out, $tag_separator);
            ?>
					</p>
				</div><!--/ post-tags -->
			<?php 
        }
        ?>
				<div class="kids_clear"></div>

			</div><!--/ post-footer-->

		</article><!--/ post-item-->
示例#3
0
        // end ! comments_open()
        ?>

		<?php 
    }
    // end have_comments()
    ?>
		 </div> 

		<!-- add comment -->
		<div class="add-comment" id="addcomments">

			<h1><?php 
    multitranslate(__('Leave a comment', 'happykids'), '_comments_reply');
    ?>
</h1>

			<div class="comment-form">

				<?php 
    $fields = array('author' => '<div class="row"><label>' . multitranslate(__('Name (required)', 'happykids'), '_comments_form_name', false) . '</label><input type="text" id="author" name="author" class="inputtext" /></div>', 'email' => '<div class="row"><label>' . multitranslate(__('Email Address (required)', 'happykids'), '_comments_form_email', false) . '</label><input type="text" name="email" id="email" class="inputtext" /></div>', 'url' => '<div class="row"><label>' . multitranslate(__('Website URL', 'happykids'), '_comments_form_web', false) . '</label><input type="text" name="url" id="url" class="inputtext" /></div>');
    comment_form(array('comment_field' => '<div class="row"><textarea cols="30" rows="10" name="comment" id="comment" class="textarea"></textarea></div>', 'id_submit' => 'post_comment', 'label_submit' => multitranslate(__('submit comment', 'happykids'), '_comments_submit', false), 'title_reply' => '', 'comment_notes_before' => '', 'comment_notes_after' => '', 'fields' => $fields));
    ?>

			</div><!--/ comment-form -->
		</div><!--/add comment -->
</div><!--/ respond -->
<?php 
}
?>
<!-- //end comments block -->
示例#4
0
function cws_portfolio_pagination($class = '', $_query = null, $num_pages = 9, $stepLink = 9, $echo = true)
{
    /* ================ Settings ================ */
    $text_num_page = multitranslate(__("Page", 'happykids'), "_tr_paginat_page", false) . ' ({current} of {last})';
    $dotright_text = __('...', 'happykids');
    $dotright_text2 = __('...', 'happykids');
    $backtext = __('Prev', 'happykids');
    $nexttext = __('Next', 'happykids');
    $first_page_text = '';
    $last_page_text = '';
    /* ============== Settings END ============== */
    if (!$_query) {
        global $wp_query;
        $posts_per_page = (int) $wp_query->query_vars['posts_per_page'];
        $paged = (int) $wp_query->query_vars['paged'];
        $max_page = $wp_query->max_num_pages;
    } else {
        $posts_per_page = (int) $_query->query_vars['posts_per_page'];
        $paged = (int) $_query->query_vars['paged'];
        $max_page = $_query->max_num_pages;
    }
    if ($max_page <= 1) {
        return false;
    }
    if (empty($paged) || $paged == 0) {
        $paged = 1;
    }
    $pages_to_show = intval($num_pages);
    $pages_to_show_minus_1 = $pages_to_show - 1;
    $half_page_start = floor($pages_to_show_minus_1 / 2);
    $half_page_end = ceil($pages_to_show_minus_1 / 2);
    $start_page = $paged - $half_page_start;
    $end_page = $paged + $half_page_end;
    if ($start_page <= 0) {
        $start_page = 1;
    }
    if ($end_page - $start_page != $pages_to_show_minus_1) {
        $end_page = $start_page + $pages_to_show_minus_1;
    }
    if ($end_page > $max_page) {
        $start_page = $max_page - $pages_to_show_minus_1;
        $end_page = (int) $max_page;
    }
    if ($start_page <= 0) {
        $start_page = 1;
    }
    $out = '';
    $out .= "<div class='" . $class . "'>\n";
    if ($text_num_page) {
        $text_num_page = preg_replace('!{current}|{last}!', '%s', $text_num_page);
        $out .= sprintf("<span class='pages'>{$text_num_page}</span>", $paged, $max_page);
    }
    if ($backtext && $paged != 1) {
        $out .= '<a class="prevpostslink" href="paged=' . ($paged - 1) . '">' . $backtext . '</a>';
    } elseif ($backtext) {
        $out .= '<a class="prevpostslink pagenavi_no_click" href="#" style="cursor:default;">' . $backtext . '</a>';
    }
    if ($start_page >= 2 && $pages_to_show < $max_page) {
        if ($dotright_text && $start_page != 2) {
            $out .= '<span class="extend page">' . $dotright_text . '</span>';
        }
    }
    for ($i = $start_page; $i <= $end_page; $i++) {
        if ($i == $paged) {
            $out .= '<span class="current">' . $i . '</span>';
        } else {
            $out .= '<a class="page" href="paged=' . $i . '">' . $i . '</a>';
        }
    }
    if ($stepLink && $end_page < $max_page) {
        for ($i = $end_page + 1; $i <= $max_page; $i++) {
            if ($i % $stepLink == 0 && $i !== $num_pages) {
                if (++$dd == 1) {
                    $out .= '<span class="extend page">' . $dotright_text2 . '</span>';
                }
                $out .= '<a class="page" href="paged=' . $i . '">' . $i . '</a>';
            }
        }
    }
    if ($end_page < $max_page) {
        if ($dotright_text && $end_page != $max_page - 1) {
            $out .= '<span class="extend page">' . $dotright_text2 . '</span>';
        }
    }
    if ($nexttext && $paged != $end_page) {
        $out .= '<a class="nextpostslink" href="paged=' . ($paged + 1) . '">' . $nexttext . '</a>';
    } elseif ($nexttext) {
        $out .= '<a class="nextpostslink pagenavi_no_click" href="#" style="cursor:default;">' . $nexttext . '</a>';
    }
    $out .= "</div>" . "\n";
    wp_reset_query();
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
示例#5
0
<?php

/**
 * Register Custom Post - Portfolio.
 *
 * @package WordPress
 * @subpackage Happy Kids
 * @since Happy Kids 1.0
 * @version     3.3.0
 */
$gen_sets = theme_get_option('general', 'gen_sets');
$permalink_slug = !empty($gen_sets['permalink_slug']) ? $gen_sets['permalink_slug'] : 'portfolio';
register_post_type('portfolio', array('labels' => array('name' => __('Portfolio', 'happykids'), 'singular_name' => multitranslate(ucfirst($permalink_slug), "_port_admin_item", false), 'add_new' => __('Add New', 'happykids'), 'add_new_item' => __('Add New Item', 'happykids'), 'edit_item' => __('Edit Item', 'happykids'), 'new_item' => __('New Item', 'happykids'), 'view_item' => __('View Item', 'happykids'), 'search_items' => __('Search Items', 'happykids'), 'not_found' => __('No item found', 'happykids'), 'not_found_in_trash' => __('No items found in Trash', 'happykids'), 'menu_name' => __('Portfolio', 'happykids')), 'singular_label' => __('Portfolio', 'happykids'), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 8, 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes'), 'has_archive' => true, 'rewrite' => array('slug' => $permalink_slug, 'with_front' => false), 'can_export' => true, 'show_in_nav_menus' => true));
//register taxonomy for portfolio
register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'labels' => array('name' => __('Portfolio Categories', 'happykids'), 'menu_name' => __('Categories', 'happykids'), 'singular_name' => __('Portfolio Category', 'happykids')), 'show_ui' => true));
示例#6
0
文件: common.php 项目: Makenrro/repos
function theme_search_form($form)
{
    $form = '<form role="search" id="search-form" method="get" action="' . home_url('/') . '" >
					<input type="text" value="' . get_search_query() . '" name="s" id="s" />
					<input class="button medium button-style1" type="submit" id="search-submit" value="' . multitranslate("Search", "_cws_search", false) . '" />
				</form>';
    return $form;
}
示例#7
0
										<?php 
        }
        ?>

									<?php 
    }
} else {
    // LOOP END
    ?>
									
										<div class="holder404">
											<div class="description_error">
												<p>
													<?php 
    multitranslate(__('Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'happykids'), '_tr_nothing_search');
    ?>
												</p>
											</div>
										</div>

									<?php 
}
?>
								<?php 
theme_pagination('pagenavi gl');
comments_template();
?>
	
								</main>
								<?php 
示例#8
0
											<div class="title_error">
												<span><?php 
__('Error', 'happykids');
?>
</span>
												<div><?php 
multitranslate(__("page not found", 'happykids'), "_404_not_found");
?>
</div>
											</div>
										</div>

										<div class="kids_clear"></div>
										<div class="description_error">
											<?php 
multitranslate(__("Unfortunately, this page is absent or unavailable", 'happykids'), "_404_unfortunately");
?>
. <br />
										</div>
									</div><!--/ 404-holder-->
								</main>
								<?php 
if (function_exists('dynamic_sidebar') && $gen_side_r) {
    echo '<aside id="sidebar-right">';
    dynamic_sidebar($gen_side_r);
    echo "</aside>";
}
?>
								
								<div class="kids_clear"></div>
							</div><!-- .entry-container -->
示例#9
0
function cws_shortcode_blog($atts, $content)
{
    extract(shortcode_atts(array('title' => '', 'cols' => '2', 'cats' => '', 'postspp' => '-1', 'usecarousel' => 0, 'img_popup' => 0, 'img_width' => 185, 'img_height' => '', 'txt_length' => 200, 'hide_date' => 0, 'hide_footer' => 0, 'hide_meta' => 0, 'button' => __('Read More', 'happykids')), $atts));
    switch ($cols) {
        case '1':
            $t_cols = "one";
            break;
        case '2':
            $t_cols = "two";
            break;
        case '3':
            $t_cols = "three";
            break;
        case '4':
            $t_cols = "four";
            break;
        default:
            $t_cols = "four";
            break;
    }
    $iso_column = 'iso-' . $t_cols . '-column iso-column';
    $coef_text = 16 / $cols;
    empty($img_height) ? $f_img_settings = array('width' => $img_width, 'crop' => true) : ($f_img_settings = array('width' => $img_width, 'height' => $img_height, 'crop' => true));
    $carousel_wrapper = $usecarousel ? "" : $iso_column;
    $wrapper = '<div class="recent_projects ' . $carousel_wrapper . '">';
    $wrapper .= empty($title) ? "" : '<h3 class="section-title">' . $title . '</h3>';
    $wrapper .= $usecarousel ? '<div class="projects_carousel blog clearfix" data-carousel-column="' . $cols . '">' : '<div class="blog grid isotope">';
    $wrapEnd = '</div><!--/ .projects-carousel --></div><!--/ .work-carousel-->';
    $posts_per_page = empty($postspp) ? '' : $postspp;
    $slideOutput = '';
    if (!empty($cats)) {
        $cats_array = explode(',', $cats);
        $query_array = array('post_type' => 'post', 'posts_per_page' => $posts_per_page, 'tax_query' => array(array('taxonomy' => 'category', 'field' => 'slug', 'terms' => $cats_array, 'operator' => 'IN')));
    } else {
        $query_array = array('posts_per_page' => $posts_per_page, 'post_type' => 'post');
    }
    $loop_cont = 0;
    $_query = new WP_Query($query_array);
    if ($_query->have_posts()) {
        while ($_query->have_posts()) {
            $_query->the_post();
            global $more;
            $more = 0;
            $categories = get_the_category();
            $separator = ', ';
            $output = '';
            if ($categories) {
                foreach ($categories as $category) {
                    $output .= '<a class="link" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(multitranslate("View all posts in", "_tr_view", false), $category->name)) . '">' . $category->cat_name . '</a>' . $separator;
                }
            }
            $tags = get_the_tags();
            $tag_out = '';
            $tag_separator = ', ';
            if ($tags) {
                $trance = multitranslate("Tag", "_tr_tag", false);
                foreach ($tags as $tag) {
                    $tag_link = get_tag_link($tag->term_id);
                    $tag_link = esc_url($tag_link);
                    $tag_out .= '<a href="' . $tag_link . '"" title="' . $trance . '"" class="link">' . $tag->name . '</a>' . $tag_separator;
                }
            }
            $slideOutput .= '<div class="iso-item"><article class="post-item">';
            if (!$hide_date) {
                $num_comments = get_comments_number();
                $commnets_wrapper = $num_comments == 0 ? '' : '<div class="post-comments"><a href="' . get_comments_link() . '"><span>' . $num_comments . '</span>' . multitranslate(__("Comments", 'happykids'), "_comments_x_comments", false) . '</a></div>';
                $slideOutput .= '<div class="post-meta">
					<div class="post-date">
						<span class="day"> ' . get_the_time('j') . '</span>
						<span class="month">' . get_the_time('M.Y') . '</span>
					</div>' . $commnets_wrapper . '</div>';
            }
            $slideOutput .= '<div class="post-entry">';
            if (has_post_thumbnail()) {
                $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'full', true);
                $img_wrapper = '<img class="pic" src="' . bfi_thumb($image[0], $f_img_settings) . '" alt="" />';
                $lightbox_wrapper = $img_popup ? '<a data-rel="prettyPhoto[lt_posts]" class="prettyPhoto kids_picture" title="' . get_the_title() . '" href="' . esc_url($image[0]) . '">' . $img_wrapper . '</a>' : $img_wrapper;
                $slideOutput .= '<div class="content-wrapper alignleft">
					<figure>
						' . $lightbox_wrapper . '
					</figure>
				</div>';
            }
            $post_cont = substr(get_the_excerpt(), 0, $txt_length);
            $slideOutput .= '<div class="entry">
								<div class="post-title">
									<a href="' . get_permalink() . '">' . get_the_title() . '</a>
								</div>' . $post_cont . ' ...</div>
							</div>';
            if (!$hide_footer) {
                $slideOutput .= '
				<div class="post-footer">
					<span class="l-float-right"><a href="' . get_permalink() . '" class="more-link cws_button">
					' . multitranslate(__("Read more", "happykids"), "_tr_moar", false) . '</a></span>';
                if (!$hide_meta) {
                    $slideOutput .= '<div class="post_cats">
						<p><span>' . multitranslate(__("Category", "happykids"), "cws_post_under_cat", false) . ':</span>' . trim($output, $separator) . '</p>
					</div>';
                }
                if ($tag_out && !$hide_meta) {
                    $slideOutput .= '<div class="post_tags">
						<p><span>' . multitranslate(__("Tags:", "happykids"), "cws_post_under_tags", false) . '</span>
							' . trim($tag_out, $tag_separator) . '</p>
					</div>';
                }
                $slideOutput .= '<div class="kids_clear"></div></div></article></div>';
            } else {
                $slideOutput .= '<div class="kids_clear"></div></article></div>';
            }
            $loop_cont++;
        }
    }
    // LOOP END
    wp_reset_query();
    $to_return = $wrapper . $slideOutput . $wrapEnd;
    return $to_return;
}