%1$s', $categories_list); }// bootstrapBasicCategoriesList } if (!function_exists('bootstrapBasicComment')) { /** * Displaying a comment * * @param object $comment * @param array $args * @param integer $depth * @return string the content already echo. */ function bootstrapBasicComment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; if ('pingback' == $comment->comment_type || 'trackback' == $comment->comment_type) { echo '
  • '; echo '
    '; echo '
    '; _e('Pingback:', 'bootstrap-basic'); comment_author_link(); edit_comment_link(__('Edit', 'bootstrap-basic'), '', ''); echo '
    '; echo '
    '; } else { echo '
  • '; echo '
    '; // footer echo '
    '; if (0 != $args['avatar_size']) { echo get_avatar($comment, $args['avatar_size']); } echo '
    '; // end footer // comment content echo '
    '; echo '
    '; echo ''; // if comment was not approved if ('0' == $comment->comment_approved) { echo '
    '; _e('Your comment is awaiting moderation.', 'bootstrap-basic'); echo '
    '; } //endif; // comment author says printf(__('%s says:', 'bootstrap-basic'), sprintf('%s', get_comment_author_link())); echo '
    '; // comment content body comment_text(); // end comment content body // reply link comment_reply_link(array_merge($args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => ' ' . __('Reply', 'bootstrap-basic'), 'login_text' => ' ' . __('Log in to Reply', 'bootstrap-basic') ))); // end reply link echo '
    '; // end comment content echo '
    '; } //endif; }// bootstrapBasicComment } if (!function_exists('bootstrapBasicCommentsPopupLink')) { /** * Custom comment popup link * * @return string */ function bootstrapBasicCommentsPopupLink() { $comment_icon = '%d'; $comments_icon = '%s'; return comments_popup_link(sprintf($comment_icon, ''), sprintf($comment_icon, '1'), sprintf($comments_icon, '%'), 'btn btn-default btn-xs'); }// bootstrapBasicCommentsPopupLink } if (!function_exists('bootstrapBasicEditPostLink')) { /** * Display edit post link * * @return string */ function bootstrapBasicEditPostLink() { return edit_post_link('', '', ''); }// bootstrapBasicEditPostLink } if (!function_exists('bootstrapBasicFullPageSearchForm')) { /** * Display full page search form * * @return string the search form element */ function bootstrapBasicFullPageSearchForm() { $output = '
    '; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= '
    '; return $output; }// bootstrapBasicFullPageSearchForm } if (!function_exists('bootstrapBasicGetLinkInContent')) { /** * get the link in content * * @return string */ function bootstrapBasicGetLinkInContent() { $content = get_the_content(); $has_url = get_url_in_content($content); if ($has_url) { return $has_url; } else { return apply_filters('the_permalink', get_permalink()); } }// bootstrapBasicGetLinkInContent } if (!function_exists('bootstrapBasicMoreLinkText')) { /** * Custom more link (continue reading) text * @return string */ function bootstrapBasicMoreLinkText() { return __('Continue reading ', 'bootstrap-basic'); }// bootstrapBasicMoreLinkText } if (!function_exists('bootstrapBasicPagination')) { /** * display pagination (1 2 3 ...) instead of previous, next of wordpress style. * * @param string $pagination_align_class * @return string the content already echo */ function bootstrapBasicPagination($pagination_align_class = 'pagination-center pagination-row') { global $wp_query; $big = 999999999; $pagination_array = paginate_links(array( 'base' => str_replace($big, '%#%', get_pagenum_link($big)), 'format' => '/page/%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'prev_text' => '«', 'next_text' => '»', 'type' => 'array' )); unset($big); if (is_array($pagination_array) && !empty($pagination_array)) { echo ''; } unset($page, $pagination_array); }// bootstrapBasicPagination } if (!function_exists('bootstrapBasicPostOn')) { /** * display post date/time and author * * @return string */ function bootstrapBasicPostOn() { $time_string = ''; if (get_the_time('U') !== get_the_modified_time('U')) { $time_string .= ''; } $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()) ); printf(__('Posted on %1$s by %2$s', 'bootstrap-basic'), sprintf('%3$s', esc_url(get_permalink()), esc_attr(get_the_time()), $time_string ), sprintf('%3$s', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'bootstrap-basic'), get_the_author())), esc_html(get_the_author()) ) ); }// bootstrapBasicPostOn } if (!function_exists('bootstrapBasicTagsList')) { /** * display tags list * * @param string $tags_list * @return string */ function bootstrapBasicTagsList($tags_list = '') { return sprintf('  %1$s', $tags_list); }// bootstrapBasicTagsList } if (!function_exists('bootstrapBasicTheAttachedImage')) { /** * Display attach image with link. * * @return string image element with link. */ function bootstrapBasicTheAttachedImage() { $post = get_post(); $attachment_size = apply_filters('bootstrap_basic_attachment_size', array(1140, 1140)); $next_attachment_url = wp_get_attachment_url(); /** * Grab the IDs of all the image attachments in a gallery so we can get the * URL of the next adjacent image in a gallery, or the first image (if * we're looking at the last image in a gallery), or, in a gallery of one, * just the link to that image file. */ $attachment_ids = get_posts(array( 'post_parent' => $post->post_parent, 'fields' => 'ids', 'numberposts' => -1, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' )); // If there is more than 1 attachment in a gallery... if (count($attachment_ids) > 1) { foreach ($attachment_ids as $attachment_id) { if ($attachment_id == $post->ID) { $next_id = current($attachment_ids); break; } } if ($next_id) { // get the URL of the next image attachment... $next_attachment_url = get_attachment_link($next_id); } else { // or get the URL of the first image attachment. $next_attachment_url = get_attachment_link(array_shift($attachment_ids)); } } printf('%3$s', esc_url($next_attachment_url), the_title_attribute(array('echo' => false)), wp_get_attachment_image($post->ID, $attachment_size, false, array('class' => 'img-responsive aligncenter')) ); }// bootstrapBasicTheAttachedImage }