function mtheme_portfolio_custom_columns($column)
 {
     global $post;
     $custom = get_post_custom();
     $image_url = wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID));
     $full_image_id = get_post_thumbnail_id($post->ID, 'thumbnail');
     $full_image_url = wp_get_attachment_image_src($full_image_id, 'thumbnail');
     $full_image_url = $full_image_url[0];
     if (!defined('MTHEME')) {
         $mtheme_shortname = "mtheme_p2";
         define('MTHEME', $mtheme_shortname);
     }
     switch ($column) {
         case "portfolio_image":
             if (isset($image_url)) {
                 echo '<a class="thickbox" href="' . $full_image_url . '"><img src="' . $image_url . '" width="60px" height="60px" alt="featured" /></a>';
             } else {
                 echo __('Image not found', 'mthemelocal');
             }
             break;
         case "description":
             if (isset($custom[MTHEME . '_thumbnail_desc'][0])) {
                 echo $custom[MTHEME . '_thumbnail_desc'][0];
             }
             break;
         case "video":
             if (isset($custom[MTHEME . '_lightbox_video'][0])) {
                 echo $custom[MTHEME . '_lightbox_video'][0];
             }
             break;
         case "types":
             echo get_the_term_list($post->ID, 'types', '', ', ', '');
             break;
     }
 }
function portfolio_columns_display($portfolio_columns, $id)
{
    global $post;
    switch ($portfolio_columns) {
        case "portfolio-image":
            $image = wp_get_attachment_image(get_post_thumbnail_id($id), 'thumb');
            if (!empty($image)) {
                echo $image;
            } else {
                $data = get_post_meta($id, '_portfolio_settings', true);
                $items = isset($data["items"]) ? $data["items"] : NULL;
                if (!empty($items)) {
                    if (is_numeric($items[0])) {
                        wp_get_attachment_image($items[0]);
                    } else {
                        global $wp_embed;
                        echo $wp_embed->run_shortcode("[embed width='300']" . $items[0] . "[/embed]");
                    }
                } else {
                    echo __("No Featured Image", 'dt_delicate');
                }
            }
            break;
        case "portfolio_entries":
            echo get_the_term_list($post->ID, 'portfolio_entries', '', ', ', '');
            break;
    }
}
Example #3
0
function favethemes_videotags()
{
    global $post;
    global $wp_query;
    $terms_as_text = strip_tags(get_the_term_list($wp_query->post->ID, 'video-tags', '', ', ', ''));
    echo $terms_as_text;
}
 public function __construct($data)
 {
     parent::__construct($data);
     if ('' === $this->name) {
         $this->name = 'taxonomy-list';
     }
     // If a taxonomy wasn't passed in, assume the first taxonomy associated with the post type.
     if (!isset($data['taxonomy'])) {
         $post_object_taxonomies = get_object_taxonomies($this->post_object);
         $this->taxonomy = array_shift($post_object_taxonomies);
     } else {
         $this->taxonomy = $data['taxonomy'];
     }
     $this->before_list = isset($data['before-list']) ? $data['before-list'] : '';
     $this->separator = isset($data['separator']) ? $data['separator'] : ', ';
     $this->after_list = isset($data['after-list']) ? $data['after-list'] : '';
     $this->include_links = isset($data['include-links']) ? $data['include-links'] : true;
     $this->tag = isset($data['tag']) ? $data['tag'] : 'p';
     if (true === $this->include_links) {
         $this->content = get_the_term_list($this->post_object->ID, $this->taxonomy, $this->before_list, $this->separator, $this->after_list);
     } else {
         $terms_arr = get_the_terms($this->post_object->ID, $this->taxonomy);
         $term_names_arr = array();
         if (!empty($terms_arr)) {
             foreach ($terms_arr as $term_obj) {
                 $term_names_arr[] = '<span class="name">' . $term_obj->name . '</span>';
             }
             $terms_list = implode($this->separator, $term_names_arr);
             $this->content = $this->before_list . $terms_list . $this->after_list;
         } else {
             $this->content = '';
         }
     }
 }
Example #5
0
function woo_tumblog_category_link($post_id = 0, $type = 'articles')
{
    $category_link = '';
    if (get_option('woo_tumblog_content_method') == 'post_format') {
        $post_format = get_post_format();
        if ($post_format == '') {
            $category = get_the_category();
            $category_name = $category[0]->cat_name;
            // Get the ID of a given category
            $category_id = get_cat_ID($category_name);
            // Get the URL of this category
            $category_link = get_category_link($category_id);
        } else {
            $category_link = get_post_format_link($post_format);
        }
    } else {
        $tumblog_list = get_the_term_list($post_id, 'tumblog', '', '|', '');
        $tumblog_array = explode('|', $tumblog_list);
        ?>
		<?php 
        $tumblog_items = array('articles' => get_option('woo_articles_term_id'), 'images' => get_option('woo_images_term_id'), 'audio' => get_option('woo_audio_term_id'), 'video' => get_option('woo_video_term_id'), 'quotes' => get_option('woo_quotes_term_id'), 'links' => get_option('woo_links_term_id'));
        ?>
		<?php 
        // Get the ID of Tumblog Taxonomy
        $category_id = $tumblog_items[$type];
        $term =& get_term($category_id, 'tumblog');
        // Get the URL of Articles Tumblog Taxonomy
        $category_link = get_term_link($term, 'tumblog');
    }
    return $category_link;
}
Example #6
0
/**
 * Generates a byline for posts and pages
 * @version 2.0
 */
function apoc_byline()
{
    // Get the current post within the loop
    global $post;
    $post_ID = $post->ID;
    $author_ID = $post->post_author;
    $type = $post->post_type;
    $byline = '';
    // Posts
    if ($type == 'post') {
        // Get some info
        $author = '<a class="post-author" href="' . get_author_posts_url($author_ID) . '" title="All posts by ' . get_the_author_meta('display_name') . '">' . get_the_author_meta('display_name') . '</a>';
        $published = '<time class="post-date" datetime="' . get_the_time('Y-m-d') . '">' . get_the_time('F j, Y') . '</time>';
        $edit_link = current_user_can('edit_post', $post_ID) ? '<a class="post-edit-link" href="' . get_edit_post_link($post_ID) . '" title="Edit this post" target="_blank">Edit</a>' : "";
        // Show a bunch of stuff for single views
        if (is_single()) {
            $avatar = new Apoc_Avatar(array('user_id' => $author_ID, 'type' => 'thumb', 'size' => 50));
            $category = get_the_term_list($post_ID, 'category', ' in ', ', ', '');
            $description = $avatar->avatar . '<span>By ' . $author . ' on ' . $published . $category . $edit_link . '</span>';
            // Otherwise, a simple one-liner
        } else {
            $description = '<span>By ' . $author . ' on ' . $published . $edit_link . '</span>';
        }
        // Pages
    } elseif ($type == 'page') {
        $description = get_post_meta($post_ID, 'description', true);
        if (current_user_can('edit_post', $post_ID)) {
            $description = $description . '<a class="post-edit-link" href="' . get_edit_post_link($post_ID) . '" title="Edit this post" target="_blank">Edit</a>';
        }
    }
    // Echo the post description
    echo $description;
}
Example #7
0
 function posttype_custom_columns($column)
 {
     global $post;
     switch ($column) {
         case "thumbnail":
             echo post_image_show() ? post_image_show(45, 45) : "<img src='" . THEME_DIR . "/resources/images/no-thumb.png'>";
             break;
         case "cause":
             echo get_the_term_list($post->ID, 'cat_cause', '', ', ', '');
             break;
         case "portfolio":
             echo get_the_term_list($post->ID, 'cat_portfolio', '', ', ', '');
             break;
         case "event":
             echo get_the_term_list($post->ID, 'cat_event', '', ', ', '');
             break;
         case "price":
             echo get_the_term_list($post->ID, 'cat_price', '', ', ', '');
             break;
         case "team":
             echo get_the_term_list($post->ID, 'cat_team', '', ', ', '');
             break;
         case "testimonial":
             echo get_the_term_list($post->ID, 'cat_testimonial', '', ', ', '');
             break;
     }
 }
function advertising_column($column, $id)
{
    $doc = get_post_meta($id, 'wp_custom_attachment_advertising', true);
    $url = get_post_meta($id, 'advertising_url', true);
    $term = get_the_term_list($id, 'tipo_advertising', " ");
    switch ($column) {
        case 'image':
            ?>
                <a href="<?php 
            echo $doc['url'];
            ?>
" target="_blank"><?php 
            echo $doc['url'];
            ?>
</a>
            <?php 
            break;
        case 'advertising_url':
            ?>
                <a href="<?php 
            echo $url;
            ?>
" target="_blank"><?php 
            echo $url;
            ?>
</a>
            <?php 
            break;
        case 'tipo':
            echo $term;
            break;
    }
}
 function staff_column_display($column, $post_id)
 {
     // Code from: http://wpengineer.com/display-post-thumbnail-post-page-overview
     switch ($column) {
         // Display the staff position
         case "staff_position":
             if ($staff_position = get_post_meta(get_the_ID(), 'wpex_staff_position', true)) {
                 echo $staff_position;
             } else {
                 echo __('None', 'wpex');
             }
             break;
             // Display the staff tags in the column view
         // Display the staff tags in the column view
         case "staff_category":
             if ($category_list = get_the_term_list($post_id, 'staff_category', '', ', ', '')) {
                 echo $category_list;
             } else {
                 echo __('None', 'wpex');
             }
             break;
             // Display the staff tags in the column view
         // Display the staff tags in the column view
         case "staff_tag":
             if ($tag_list = get_the_term_list($post_id, 'staff_tag', '', ', ', '')) {
                 echo $tag_list;
             } else {
                 echo __('None', 'wpex');
             }
             break;
     }
 }
function portfolio_column_display($portfolio_columns, $post_id)
{
    // Code from: http://wpengineer.com/display-post-thumbnail-post-page-overview
    switch ($portfolio_columns) {
        // Display the thumbnail in the column view
        case "thumbnail":
            $width = (int) 35;
            $height = (int) 35;
            $thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
            // Display the featured image in the column view if possible
            if ($thumbnail_id) {
                $thumb = wp_get_attachment_image($thumbnail_id, array($width, $height), true);
            }
            if (isset($thumb)) {
                echo $thumb;
            } else {
                echo __('None', 'portfolioposttype');
            }
            break;
            // Display the portfolio tags in the column view
        // Display the portfolio tags in the column view
        case "portfolio_filter":
            if ($category_list = get_the_term_list($post_id, 'portfolio_filter', '', ', ', '')) {
                echo $category_list;
            } else {
                echo __('None', 'portfolioposttype');
            }
            break;
    }
}
function populate_mbdb_book_columns($column, $post_id)
{
    // get the book for the current row
    $book = MBDB()->books->get($post_id);
    // if the book is invalid, exit
    if ($book == null) {
        return;
    }
    // if this is the genre or series column (taxonomies)
    // just get the term list and display that delimited by commas
    // and then exit. No further processing necessary
    if ($column == 'mbdb_genre' || $column == 'mbdb_series') {
        do_action('mbdb_book_pre_' . $column . '_column');
        echo apply_filters('mbdb_book_' . $column . '_column', get_the_term_list($post_id, $column, '', ', '));
        do_action('mbdb_book_post_' . $column . '_column');
        return;
    }
    // if the column is a property of book, grab that data
    if (property_exists($book, $column)) {
        $data = $book->{$column};
    } else {
        $data = '';
    }
    switch ($column) {
        // book cover: display as an image
        case 'cover':
            do_action('mbdb_book_pre_mbdb_cover_column', $column, $data, $book);
            if ($data != '') {
                $alt = mbdb_get_alt_text($book->cover_id, __('Book Cover:', 'mooberry-book-manager') . ' ' . get_the_title($post_id));
                echo apply_filters('mbdb_book_mbdb_cover_column', '<IMG SRC="' . esc_url($data) . '" width="100" ' . $alt . ' />', $column, $data, $book);
            }
            do_action('mbdb_book_post_mbdb_cover_column', $column, $data, $book);
            break;
            // release date: use short format
        // release date: use short format
        case 'release_date':
            do_action('mbdb_book_pre_mbdb_published_column', $column, $data, $book);
            if (!empty($data)) {
                // TO DO validate data to be a date??
                /* translators: short date format. see http://php.net/date */
                echo apply_filters('mbdb_book_mbdb_published_column', date(__('m/d/Y'), strtotime($data)), $column, $data, $book);
            }
            do_action('mbdb_book_post_mbdb_published_column', $column, $data, $book);
            break;
            // publisher: display publisher name
            // does not come from book object
        // publisher: display publisher name
        // does not come from book object
        case 'publisher_id':
            $publisher = mbdb_get_publisher_info($data);
            do_action('mbdb_book_pre_mbdb_publisher_column', $column, $publisher, $book);
            echo apply_filters('mbdb_book_mbdb_publisher_column', $publisher['name'], $column, $publisher, $book);
            do_action('mbdb_book_post_mbdb_publisher_column', $column, $publisher, $book);
            break;
        default:
            do_action('mbdb_book_pre_mbdb_' . $column . '_column', $column, $data, $book);
            echo apply_filters('mbdb_book_mbdb_' . $column . '_column', $data, $book, $post_id, $column);
            do_action('mbdb_book_post_mbdb_' . $column . '_column', $column, $data, $book);
    }
}
/**
 * Render Donwload Columns
 *
 * Render the custom columns content.
 *
 * @access      private
 * @since       1.0 
 * @return      void
*/
function edd_render_download_columns($column_name, $post_id)
{
    if (get_post_type($post_id) == 'download') {
        $sales = edd_get_download_sales_stats($post_id);
        $earnings = edd_get_download_earnings_stats($post_id);
        $color = get_post_meta($post_id, '_edd_purchase_color', true);
        $color = $color ? $color : 'blue';
        $purchase_text = get_post_meta($post_id, '_edd_purchase_text', true);
        $purchase_text = $purchase_text && '' !== $purchase_text ? $purchase_text : __('Purchase', 'edd');
        switch ($column_name) {
            case 'download_category':
                echo get_the_term_list($post_id, 'download_category', '', ', ', '');
                break;
            case 'download_tag':
                echo get_the_term_list($post_id, 'download_tag', '', ', ', '');
                break;
            case 'price':
                echo edd_price($post_id, false);
                if (!edd_has_variable_prices($post_id)) {
                    echo '<input type="hidden" class="downloadprice-' . $post_id . '" value="' . edd_get_download_price($post_id) . '" />';
                }
                break;
            case 'sales':
                echo $sales;
                break;
            case 'earnings':
                echo edd_currency_filter($earnings);
                break;
            case 'shortcode':
                echo '[purchase_link id="' . absint($post_id) . '" text="' . esc_html($purchase_text) . '" style="button" color="' . esc_attr($color) . '"]';
                break;
        }
    }
}
function kbe_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "title":
            the_title();
            break;
        case "author":
            the_author();
            break;
        case "cat":
            echo get_the_term_list($post->ID, 'kbe_taxonomy', ' ', ', ', '');
            break;
        case "tag":
            echo get_the_term_list($post->ID, 'kbe_tags', ' ', ', ', '');
            break;
        case "comment":
            comments_number(__('No Comments', 'kbe'), __('1 Comment', 'kbe'), __('% Comments', 'kbe'));
            break;
        case "views":
            $views = get_post_meta($post->ID, 'kbe_post_views_count', true);
            if ($views) {
                echo $views . __(' Views', 'kbe');
            } else {
                echo __('No Views', 'kbe');
            }
            break;
        case "date":
            the_date();
            break;
    }
}
Example #14
0
 function get_be_themes_portfolio_category_list($id, $link = false)
 {
     $terms = wp_get_object_terms($id, 'portfolio_categories');
     $category = "";
     $taxonomies = get_the_term_list($id, 'portfolio_categories', '', ' / ', '');
     $taxonomies = strip_tags($taxonomies);
     $term_count = count($terms);
     $i = 0;
     if ($link) {
         foreach ($terms as $term) {
             $term_link = get_term_link($term);
             if (++$i === $term_count) {
                 $category .= '<a href="' . $term_link . '" class="cat-list">' . $term->name . '</a>';
             } else {
                 $category .= '<a href="' . $term_link . '" class="cat-list">' . $term->name . '</a><span> &middot; </span>';
             }
         }
     } else {
         foreach ($terms as $term) {
             if (++$i === $term_count) {
                 $category .= $term->slug;
             } else {
                 $category .= $term->slug . " | ";
             }
         }
     }
     return $category;
 }
Example #15
0
function client_columns_display($client_columns, $post_id)
{
    switch ($client_columns) {
        // Code from: http://wpengineer.com/display-post-thumbnail-post-page-overview
        case "client_thumbnail":
            $thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
            if ($thumbnail_id) {
                $thumb = wp_get_attachment_image($thumbnail_id, array(70, 70), true);
            }
            if (isset($thumb) && $thumb) {
                echo $thumb;
            } else {
                echo __('None', 'EBD');
            }
            break;
        case "client-cats":
            global $post;
            if ($cat_list = get_the_term_list($post->ID, 'client_cats', '', ', ', '')) {
                echo $cat_list;
            } else {
                echo __('None', 'EBD');
            }
            break;
    }
}
function ut_publication_custom_columns($column)
{
    global $post;
    switch ($column) {
        case 'ut_publication_cover':
            $pub_cover = get_post_meta($post->ID, 'ut_publication_cover', true);
            if ($pub_cover) {
                ?>
      <img src="<?php 
                echo $pub_cover;
                ?>
" alt="" width="50">
      <?php 
            } else {
                ?>
    <img src="<?php 
                echo get_template_directory_uri();
                ?>
/img/placeholder_publication.png" width="50">
    <?php 
            }
            break;
        case 'pubcat':
            echo get_the_term_list($post->ID, 'pubcat', '', ', ', '');
            break;
        case 'ut_publication_author':
            echo get_post_meta($post->ID, 'ut_publication_author', true);
            break;
        case 'ut_publication_publisher':
            echo get_post_meta($post->ID, 'ut_publication_publisher', true);
            break;
        case 'ut_publication_year':
            echo get_post_meta($post->ID, 'ut_publication_year', true);
    }
}
Example #17
0
/**
 * Render Popup Columns
 *
 * @since 1.0
 *
 * @param string $column_name Column name
 * @param int $post_id Popup (Post) ID
 *
 * @return void
 */
function popmake_render_popup_columns($column_name, $post_id)
{
    if (get_post_type($post_id) == 'popup') {
        global $popmake_options;
        $post = get_post($post_id);
        setup_postdata($post);
        $post_type_object = get_post_type_object($post->post_type);
        $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID);
        switch ($column_name) {
            case 'popup_title':
                echo '<strong>' . esc_html(popmake_get_the_popup_title($post_id)) . '</strong>';
                break;
            case 'popup_category':
                echo get_the_term_list($post_id, 'popup_category', '', ', ', '');
                break;
            case 'popup_tag':
                echo get_the_term_list($post_id, 'popup_tag', '', ', ', '');
                break;
            case 'class':
                echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . absint($post_id) . '</code></pre>';
                if ($post->post_name != $post->ID) {
                    echo '|';
                    echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . $post->post_name . '</code></pre>';
                }
                break;
        }
    }
}
/**
 * Render Download Columns
 *
 * @since 1.0
 * @param string $column_name Column name
 * @param int $post_id Download (Post) ID
 * @return void
 */
function edd_render_download_columns($column_name, $post_id)
{
    if (get_post_type($post_id) == 'download') {
        global $edd_options;
        $style = isset($edd_options['button_style']) ? $edd_options['button_style'] : 'button';
        $color = isset($edd_options['checkout_color']) ? $edd_options['checkout_color'] : 'blue';
        $purchase_text = !empty($edd_options['add_to_cart_text']) ? $edd_options['add_to_cart_text'] : __('Purchase', 'edd');
        switch ($column_name) {
            case 'download_category':
                echo get_the_term_list($post_id, 'download_category', '', ', ', '');
                break;
            case 'download_tag':
                echo get_the_term_list($post_id, 'download_tag', '', ', ', '');
                break;
            case 'price':
                if (edd_has_variable_prices($post_id)) {
                    echo edd_price_range($post_id);
                } else {
                    echo edd_price($post_id, false);
                    echo '<input type="hidden" class="downloadprice-' . $post_id . '" value="' . edd_get_download_price($post_id) . '" />';
                }
                break;
            case 'sales':
                echo edd_get_download_sales_stats($post_id);
                break;
            case 'earnings':
                echo edd_currency_filter(edd_format_amount(edd_get_download_earnings_stats($post_id)));
                break;
            case 'shortcode':
                echo '[purchase_link id="' . absint($post_id) . '" text="' . esc_html($purchase_text) . '" style="' . $style . '" color="' . esc_attr($color) . '"]';
                break;
        }
    }
}
 public function getColumn($column)
 {
     global $post;
     switch ($column) {
         case 'category':
             echo get_the_term_list($post->ID, $post->post_type . '_category', '', ', ', '');
             break;
         case 'thumbnail':
             if ($post->Thumbnail) {
                 echo GummRegistry::get('Helper', 'Media')->display($post->Thumbnail->guid, array('width' => 70, 'height' => 70));
             }
             break;
         case 'gallery_album':
             echo get_the_term_list($post->ID, 'gallery_album', '', ', ', '');
             break;
         case 'portfolio_cats':
             echo get_the_term_list($post->ID, 'portfolio_cat', '', ', ', '');
             break;
         case $post->post_type . '_author':
             $author = isset($post->PostMeta['author']) ? $post->PostMeta['author'] : '';
             $organisation = isset($post->PostMeta['organisation']) ? $post->PostMeta['organisation'] : '';
             echo '<span class="testimonial_author_name">' . $author . '</span>';
             if ($organisation) {
                 echo ' - <span class="testimonial_author_occupation">' . $organisation . '</span>';
             }
             break;
         case $post->post_type . '_excerpt':
             edit_post_link(GummRegistry::get('Helper', 'Text')->truncate(get_the_excerpt(), 100, array('exact' => false)));
             break;
     }
 }
Example #20
0
/**
 * Returns taxominy for custom post types sans <a> links
 * @uses get_the_term_list
 * 
 * @param current post ID, most likely will be $post->id
 * @param registered taxominy to return
 */
function jaechick_terms($post_id, $tax)
{
    $author_term = get_the_term_list($post_id, $tax);
    if (!empty($author_term)) {
        echo '', strip_tags($author_term), '';
    }
}
Example #21
0
function manage_product_columns($column_name, $product_id)
{
    $price_value = product_price($product_id);
    switch ($column_name) {
        case 'id':
            echo $product_id;
            break;
        case 'shortcode':
            echo '[show_products product="' . $product_id . '"]';
            break;
        case 'price':
            if ($price_value != '') {
                echo price_format($price_value);
            }
            break;
        case 'image':
            echo the_post_thumbnail(array(40, 40));
            break;
        case 'product_cat':
            echo get_the_term_list($product_id, 'al_product-cat', '', ', ', '');
            break;
        default:
            break;
    }
}
/**
 * add the ad meta in the loop after the ad title 
 * @since 3.1
 */
function cp_ad_loop_meta()
{
    if (is_page() || is_singular(APP_POST_TYPE)) {
        return;
    }
    // don't do ad-meta on pages
    global $post;
    if ($post->post_type == 'page') {
        return;
    }
    ?>
	
    <p class="post-meta">
        <span class="folder"><?php 
    if ($post->post_type == 'post') {
        the_category(', ');
    } else {
        echo get_the_term_list($post->ID, APP_TAX_CAT, '', ', ', '');
    }
    ?>
</span> | <span class="owner"><?php 
    if (get_option('cp_ad_gravatar_thumb') == 'yes') {
        appthemes_get_profile_pic(get_the_author_meta('ID'), get_the_author_meta('user_email'), 16);
    }
    the_author_posts_link();
    ?>
</span> | <span class="clock"><span><?php 
    echo appthemes_date_posted($post->post_date);
    ?>
</span></span>
    </p>
<?php 
}
 /**
  * Display of Custom Post Type Columns
  * @param array $column
  * @since  1.0.0
  */
 public function custom_columns($column)
 {
     global $post;
     switch ($column) {
         case 'title':
             the_title();
             break;
         case 'author':
             the_author();
             break;
         case 'cat':
             echo get_the_term_list($post->ID, 'docu_cat', ' ', ', ', '');
             break;
         case 'tag':
             echo get_the_term_list($post->ID, 'docu_tag', ' ', ', ', '');
             break;
         case 'comment':
             comments_number(__('No Comments', 'documentate'), __('1 Comment', 'documentate'), __('% Comments', 'documentate'));
             break;
         case 'views':
             $views = get_post_meta($post->ID, 'documentate_post_views_count', true);
             if ($views) {
                 printf(_n('%s view', '%s views', $rating, 'documentate'), $views);
             } else {
                 echo __('No Views', 'documentate');
             }
             break;
         case 'date':
             the_date();
             break;
     }
 }
function photograph_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "photograph-categories":
            echo get_the_term_list($post->ID, 'photograph-categories', '', ', ', '');
            break;
        case "likes":
            if (function_exists('get_like')) {
                echo get_like($post - ID);
            }
            break;
        case "photo":
            if (has_post_thumbnail()) {
                the_post_thumbnail(array(75, 75));
            }
            break;
        case "feature":
            $url = wp_nonce_url(admin_url('admin-ajax.php?action=photograph-feature&id=' . $post->ID), 'photograph-feature');
            if (get_post_meta($post->ID, 'colabs_feature_photograph', true) == 'true') {
                $icon = '<img src="' . get_template_directory_uri() . '/images/on.png" />';
            } else {
                $icon = '<img src="' . get_template_directory_uri() . '/images/off.png" />';
            }
            echo '<a href="' . $url . '">' . $icon . '</a>';
            break;
    }
}
Example #25
0
 /**
  * Display course categories.
  */
 function edr_show_course_categories()
 {
     $categories = get_the_term_list(get_the_ID(), 'ib_educator_category', '', __(', ', 'ibeducator'));
     if ($categories) {
         Edr_View::the_template('course/categories', array('categories' => $categories));
     }
 }
function gallery_custom_columns($column)
{
    global $post;
    switch ($column) {
        case 'gallery-thumb':
            if (has_post_thumbnail($post->ID)) {
                ?>
					<a href="<?php 
                the_permalink();
                ?>
" target="_blank">
						<?php 
                the_post_thumbnail('square-menu-thumbnail');
                ?>
					</a>
					<?php 
            } else {
                _e('No Thumbnail', 'framework');
            }
            break;
        case 'type':
            echo get_the_term_list($post->ID, 'gallery-item-type', '', ', ', '');
            break;
    }
}
 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     extract($args);
     // User-selected settings
     $title = $instance['title'];
     $title = apply_filters('widget_title', $title);
     $date_display = isset($instance['date_display']);
     $client_display = isset($instance['client_display']);
     $category_display = isset($instance['category_display']);
     $tag_display = isset($instance['tag_display']);
     $button_label = $instance['button_label'] != '' ? $instance['button_label'] : __('Launch', 'mtphr-galleries');
     $button_target = $instance['button_target'];
     // Before widget (defined by themes)
     echo $before_widget;
     // Title of widget (before and after defined by themes)
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<table>';
     if ($date_display) {
         echo '<tr>';
         echo '<th>' . __('Date:', 'mtphr-galleries') . '</th>';
         echo '<td>' . get_the_time(get_option('date_format')) . '</td>';
         echo '</tr>';
     }
     if ($client_display) {
         $client = get_post_meta(get_the_id(), '_mtphr_gallery_client', true);
         if ($client != '') {
             echo '<tr>';
             echo '<th>' . __('Client:', 'mtphr-galleries') . '</th>';
             echo '<td>' . sanitize_text_field($client) . '</td>';
             echo '</tr>';
         }
     }
     if ($category_display) {
         $terms = get_the_term_list(get_the_id(), 'mtphr_gallery_category', '', ', ', '');
         if ($terms != '') {
             echo '<tr>';
             echo '<th>' . __('Categories:', 'mtphr-galleries') . '</th>';
             echo '<td>' . $terms . '</td>';
             echo '</tr>';
         }
     }
     if ($tag_display) {
         $terms = get_the_term_list(get_the_id(), 'mtphr_gallery_tag', '', ', ', '');
         if ($terms != '') {
             echo '<tr>';
             echo '<th>' . __('Tags:', 'mtphr-galleries') . '</th>';
             echo '<td>' . $terms . '</td>';
             echo '</tr>';
         }
     }
     echo '</table>';
     $link = get_post_meta(get_the_id(), '_mtphr_gallery_link', true);
     if ($link != '') {
         echo '<a class="btn mtphr-gallery-link" href="' . esc_url($link) . '" target="' . $button_target . '">' . $button_label . '</a>';
     }
     // After widget (defined by themes)
     echo $after_widget;
 }
Example #28
0
 /**
  * Prints HTML with meta information for the categories, tags.
  *
  * @since Cyanotype 1.0
  */
 function cyanotype_entry_meta()
 {
     if ('post' == get_post_type()) {
         $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'cyanotype'));
         if ($categories_list && cyanotype_categorized_blog()) {
             printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'cyanotype'), $categories_list);
         }
         $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'cyanotype'));
         if ($tags_list) {
             printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'cyanotype'), $tags_list);
         }
     }
     if ('jetpack-portfolio' == get_post_type()) {
         $project_types_list = get_the_term_list($post->ID, 'jetpack-portfolio-type', '', _x(', ', 'Used between list items, there is a space after the comma.', 'cyanotype'), '');
         if ($project_types_list) {
             printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Project Types', 'Used before project type names.', 'cyanotype'), $project_types_list);
         }
         $project_tag_list = get_the_term_list($post->ID, 'jetpack-portfolio-tag', '', _x(', ', 'Used between list items, there is a space after the comma.', 'cyanotype'), '');
         if ($project_tag_list) {
             printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Project Tags', 'Used before project tag names.', 'cyanotype'), $project_tag_list);
         }
     }
     if (is_attachment() && wp_attachment_is_image()) {
         // Retrieve attachment metadata.
         $metadata = wp_get_attachment_metadata();
         printf('<span class="full-size-link"><span class="screen-reader-text">%1$s </span><a href="%2$s">%3$s &times; %4$s</a></span>', _x('Full size', 'Used before full size attachment link.', 'cyanotype'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
     }
     if (!post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(__('Leave a comment', 'cyanotype'), __('1 Comment', 'cyanotype'), __('% Comments', 'cyanotype'));
         echo '</span>';
     }
 }
 /**
  * Echo the widget content.
  *
  * @since 0.1.8
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     global $wp_query, $_genesis_displayed_ids;
     extract($args);
     // Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     echo $before_widget;
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $query_args = array('post_type' => 'listing', 'taxonomy' => $instance['taxonomy'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
     // Exclude displayed IDs from this loop?
     global $post;
     $wp_query = new WP_Query($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             $_genesis_displayed_ids[] = get_the_ID();
             genesis_markup(array('html5' => '<article %s><div class="listing-wrap">', 'xhtml' => sprintf('<div class="%s"><div class="listing-wrap">', implode(' ', get_post_class())), 'context' => 'entry'));
             $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-post-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
             if ($instance['show_image']) {
                 if ($image) {
                     printf('<a href="%s" alt="%s">%s</a>', esc_url(get_permalink()), esc_attr(the_title_attribute('echo=0')), wp_kses_post($image));
                 } else {
                     $fallback = plugins_url('includes/sample-images/simple-listings.png', dirname(__FILE__));
                     printf('<a href="%s"><img src="%s" alt="%s" />', esc_url(get_permalink()), esc_url($fallback), esc_attr(the_title_attribute('echo=0')));
                 }
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '<header class="entry-header">' : '';
             }
             if (!empty($instance['show_title'])) {
                 printf('<h2 class="entry-title">%s</h2>', the_title_attribute('echo=0'), get_the_title());
             }
             if (!empty($instance['show_status'])) {
                 echo '<span class="listing-status">' . strip_tags(get_the_term_list($post->ID, 'status', '', ', ', '')) . '</span>';
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '</header>' : '';
             }
             if (!empty($instance['show_content'])) {
                 echo genesis_html5() ? '<div class="entry-content">' : '';
                 global $more;
                 $orig_more = $more;
                 $more = 0;
                 the_content(esc_html($instance['more_text']));
                 $more = $orig_more;
                 echo genesis_html5() ? '</div>' : '';
             }
             genesis_markup(array('html5' => '</div></article>', 'xhtml' => '</div></div>'));
         }
     }
     if (!empty($instance['archive_link']) && !empty($instance['archive_text'])) {
         printf('<p class="more-from-category"><a href="%1$s">%2$s</a></p>', esc_url(get_post_type_archive_link($instance['post_type'])), esc_html($instance['archive_text']));
     }
     // Restore original query
     wp_reset_query();
     echo $after_widget;
 }
function ts_portfolio_item_func($atts, $content = null)
{
    extract(shortcode_atts(array('animation' => '', 'animation_delay' => '', 'animation_iteration' => '', 'id' => 0), $atts));
    global $post;
    $html = '';
    $new_post = null;
    if (!empty($id)) {
        $new_post = get_post($id);
    }
    if ($new_post) {
        $post = $new_post;
        setup_postdata($post);
        $image = '';
        $slider = '';
        $portfolio_slider = ts_get_post_opt('portfolio_slider');
        if (is_array($portfolio_slider) && count($portfolio_slider) > 0) {
            foreach ($portfolio_slider as $slide) {
                if (!empty($slide['image'])) {
                    $image = theme_thumb($slide['image'], 370, 270, 'c');
                }
                $slider .= ' 
					<div class="col-sm-12 col-md-12">
					  <img src="' . esc_url($image) . '" alt="" title="">
					</div>';
            }
        }
        if (!empty($slider)) {
            $gallery = '
				<div class="carousel-box load" data-carousel-pagination="true" data-carousel-nav="false" data-carousel-one="true">
					<div class="row">
						<div class="carousel">' . $slider . '</div>
					</div>
					<div class="clearfix"></div>
					<div class="pagination switches"></div>
				</div>';
        } else {
            $gallery = '<img src="' . esc_url(get_xv_thumbnail(370, 270)) . '" class="single-image" />';
        }
        $html = '
			<div class="work-single row ' . ts_get_animation_class($animation) . '" ' . ts_get_animation_data_class($animation_delay, $animation_iteration) . '>
				<div class="images-box col-sm-5 col-md-4">
					' . $gallery . '
				</div>

				<div class="work-description col-sm-7 col-md-8">
				  <h3 class="title">' . get_the_title() . '</h3>
				  <div class="type">' . xv_get_field('client') . '</div>

				  <div>
					' . apply_filters('the_content', get_the_content()) . '
					<div class="tags"><b>' . __('Categories', 'progressive') . ': </b>' . strip_tags(get_the_term_list($post->ID, 'portfolio_category', '', ', ')) . '</div>
				  </div>
				</div>
				<div class="clearfix"></div>
			  </div>';
        wp_reset_postdata();
    }
    return $html;
}