%1$s', $categories_list); } // gazelaCategoriesList /** * Displaying a comment * * @param object $comment * @param array $args * @param integer $depth * @return string the content already echo. */ function gazelaComment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; echo '
  • '; echo '
    '; edit_comment_link(); echo '
    '; echo '
    '; echo 'Posted by ' . get_comment_author() . ',
    '; echo ''; comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); echo '
    '; comment_text(); echo '
  • '; } // gazelaComment /** * Custom comment popup link * * @return string */ function gazelaCommentsPopupLink() { $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'); } // gazelaCommentsPopupLink /** * Display edit post link * * @return string */ function gazelaEditPostLink() { return edit_post_link('', '', ''); } // gazelaEditPostLink /** * Display full page search form * * @return string the search form element */ function gazelaFullPageSearchForm() { $output = '
    '; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
    '; $output .= '
    '; return $output; } // gazelaFullPageSearchForm /** * get the link in content * * @return string */ function gazelaGetLinkInContent() { $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()); } } // gazelaGetLinkInContent /** * Custom more link (continue reading) text * @return string */ function gazelaMoreLinkText() { return __('Continue reading', 'gazela'); } // gazelaMoreLinkText /** * display pagination (1 2 3 ...) instead of previous, next of wordpress style. * * @param string $pagination_align_class * @return string the content already echo */ function gazelaPagination($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); } // gazelaPagination /** * display post date/time and author * * @return string */ function gazelaPostOn() { echo 'Posted on ' . get_the_time(get_option('date_format')) . ' by ' . get_the_author(); } // gazelaPostOn /** * display tags list * * @param string $tags_list * @return string */ function gazelaTagsList($tags_list = '') { return sprintf('  %1$s', $tags_list); } // gazelaTagsList /** * Display attach image with link. * * @return string image element with link. */ function gazelaTheAttachedImage() { $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')) ); } // gazelaTheAttachedImage