if (have_posts()) { while (have_posts()) { the_post(); ?> <li> <a href="<?php echo get_permalink(); ?> " class="post-list-thumb-wrap"> <?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array(5600, 1000), false, ''); //Returns All Term Items for "my_taxonomy" $category = wp_get_post_terms($post->ID, 'article_cat', array("fields" => "names")); $countries = wp_get_post_terms($post->ID, 'article_country_cat', array("fields" => "names")); $authorID = get_the_author_meta($post->ID); $curator_profile = get_cupp_meta($authorID, 'thumbnail'); $custom_image_link = get_post_meta($post->ID, '_custom_image_link', true); ?> <div class="postimg" style="background: url(<?php echo $custom_image_link != '' ? $custom_image_link : $src[0]; ?> )"></div> </a> <div class="labels"> <?php if ($countries) { ?> <?php foreach ($countries as $country) { ?>
function cupp_avatar($avatar, $id_or_email, $size, $default, $alt) { $user = false; $id = false; if (is_numeric($id_or_email)) { $id = (int) $id_or_email; $user = get_user_by('id', $id); } elseif (is_object($id_or_email)) { if (!empty($id_or_email->user_id)) { $id = (int) $id_or_email->user_id; $user = get_user_by('id', $id); } } else { // $id = (int) $id_or_email; $user = get_user_by('email', $id_or_email); } if ($user && is_object($user)) { $custom_avatar = get_cupp_meta($id, 'thumbnail'); if (isset($custom_avatar) && !empty($custom_avatar)) { $avatar = "<img alt='{$alt}' src='{$custom_avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; } } return $avatar; }
<?php /* Template Name: Order History */ get_header(); // Retrieve The Post's Author ID $author_id = $GLOBALS['current_user']->ID; // Set the image size. Accepts all registered images sizes and array(int, int) $size = 'thumbnail'; // Get the image URL using the author ID and image size params $imgURL = get_cupp_meta($author_id, $size); $GLOBALS['bgimg'] = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); do_action('woocommerce_before_my_account'); ?> <div class="contentWeb"> <div class="my-account-content" style="background-image:url(<?php echo $GLOBALS['bgimg'][0]; ?> );"> <div class="wrapper wrap"> <div class="bread">Home / My Account</div> <div class="dash"> <div class="top"> <?php get_template_part('content', 'menuresponsive-myaccount'); ?> <h1>Order History</h1> <!-- <div class="search"> <input type="text" placeholder="TITLE, DEPARTMENT, RECIPIENT">
<!-- Tab panes --> <ul class="post-list-thumb curator-list-thumb"> <?php #$users = get_users( 'orderby=nicename&role=subscriber&post_per_page=2' ); $users = get_users('orderby=nicename&post_per_page=2'); // Start the Loop. foreach ($users as $user) { $fb_user_access_token = get_user_meta($user->ID, 'fb_user_access_token', true); $fb_profile_picture = get_user_meta($user->ID, 'fb_profile_picture', true); if ($fb_user_access_token != '') { $profile = get_user_meta($user->ID, 'fb_profile_picture', true); } else { if (get_cupp_meta($user->ID, 'thumbnail')) { $profile = get_cupp_meta($user->ID, 'thumbnail'); } else { $profile = get_template_directory_uri() . "/images/default-image.jpg"; } } // $curator_profile = get_cupp_meta($user->ID, 'thumbnail'); $post_count = count_user_posts($user->ID, 'acme_article'); ?> <li> <a href="<?php echo site_url(); ?> /curator-detail/?id=<?php echo $user->ID; ?> " class="post-list-thumb-wrap curator-list">
<div class="wrapper wrap"> <h1>Recent Post</h1> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php // Retrieve The Post's Author ID $user_id = get_the_author_meta('ID'); // Set the image size. Accepts all registered images sizes and array(int, int) $size = 'thumbnail'; // Get the image URL using the author ID and image size params $imgURL = get_cupp_meta($user_id, $size); ?> <div class="blog-post-row"> <div class="left"> <span class="profile-picture" style="background-image: url('<?php echo $imgURL; ?> ');"></span> </div> <div class="right"> <h2>John Done</h2> <h1>LOREM IPSUM SOME TITLE HERE FOR THE POST</h1> <span class="date">April 24 - 2014</span> <p>Lorem ipsum dolor sit amet, usu alterum ceteros at. Nobis reprehendunt nam ei, an dico quot inciderint vim. Ut noster nusquam definitiones vim, his ne assueverit cotidieque. Eu aeterno vocibus vim, splendide forensibus constituam ea cum, ut perfecto molestiae sed. Usu postea mollis epicuri no, est ea perfecto patrioque, ex unum nostro vix..</p> </div>
function default_ajax_request() { global $wp_query; $params = array('post_type' => $_POST['post_type'], 'posts_per_page' => $_POST['posts_per_page'], 'paged' => $_POST['paged'], 'post_status' => $_POST['status'], 'orderby' => $_POST['orderby'], 'order' => $_POST['order']); $ctr = 0; $wp_query = new WP_Query($params); $html = ""; if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); $category = wp_get_post_terms($post->ID, 'article_cat', array("fields" => "names")); $countries = wp_get_post_terms($post->ID, 'article_country_cat', array("fields" => "names")); $authorID = get_the_author_meta($post->ID); $curator_profile = get_cupp_meta($authorID, 'thumbnail'); $custom_image_link = get_post_meta($post->ID, '_custom_image_link', true); $html .= '<li>'; $html .= '<a href="' . get_permalink() . '" class="post-list-thumb-wrap">'; $html .= '<div class="postimg" style="background: url(' . getArticleImage($post->ID) . ')"></div>'; $html .= '</a>'; $html .= '<div class="labels">'; if ($countries) { foreach ($countries as $country) { $html .= '<a href="/search-results/?country=' . $country . '&category=select+category&post_type=post+type+curators-cat" class="countrylabel">'; $html .= '<i class="fa fa-map-marker"></i>'; $html .= $country; $html .= '</a>'; } } if ($category) { foreach ($category as $country) { $html .= '<a href="/search-results/?country=select&category=' . $category . '+category&post_type=post+type+curators-cat" class="countrylabel">'; $html .= '<i class="fa fa-map-marker"></i>'; $html .= $category; $html .= '</a>'; } } $html .= '</div>'; $html .= '</li>'; $ctr++; } } echo json_encode(array('post' => $_POST, 'paged' => $_POST['paged'], 'post_status' => $_POST['status'], 'result' => $html, 'count' => $ctr, 'max' => $wp_query->max_num_pages)); die; }
<div class="author-info"> <div class="author-avatar"> <?php if (function_exists('get_cupp_meta')) { ?> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?> "> <img src="<?php echo get_cupp_meta(get_the_author_meta('ID'), 'thumbnail'); ?> " alt=""/> </a> <?php } else { ?> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?> "> <?php echo get_avatar(get_the_author_meta('ID'), apply_filters('wheels_author_bio_avatar_size', 120)); ?> </a> <?php } ?> </div> <div class="author-description"> <h2 class="author-title"><?php
public function render($atts, $content = null) { extract(shortcode_atts(array('user_id' => '', 'image_size' => 'thumbnail', 'el_class' => ''), $atts)); // $content = wpb_js_remove_wpautop($content); // fix unclosed/unwanted paragraph tags in $content ob_start(); $user = get_user_by('id', (int) $user_id); if (!$user) { return ''; } $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'dntp-teacher ' . $el_class, $this->namespace, $atts); ?> <div class="<?php echo $css_class; ?> "> <?php if (function_exists('get_cupp_meta')) { ?> <a href="<?php echo esc_url(get_author_posts_url($user->ID)); ?> "> <img src="<?php echo get_cupp_meta($user->ID, $image_size); ?> " alt=""/> </a> <?php } else { ?> <a href="<?php echo esc_url(get_author_posts_url($user->ID)); ?> "> <?php echo get_avatar($user->ID, apply_filters('wheels_author_bio_avatar_size', 120)); ?> </a> <?php } ?> </div> <?php echo $user->user_nicename; ?> <?php $content = ob_get_clean(); return $content; }