function jellythemes_photos_list($atts, $content = null)
{
    extract(shortcode_atts(array('limit' => 8), $atts));
    $return = '
		        <nav class="primary"><ul>
	                          <li><a class="selected" href="#" data-filter="*"><span>' . __('All photos', 'jellythemes') . '</span></a></li>';
    $types = get_terms('type', array('hide_empty' => 0));
    if ($types && !is_wp_error($types)) {
        foreach ($types as $type) {
            $return .= '<li><a href="#" data-filter=".' . esc_js($type->slug) . '"><span>' . $type->name . '</span></a></li>';
        }
    }
    $return .= '</ul></nav>
                        <div class="portfolio">';
    $photos = new WP_Query(array('post_type' => 'photo', 'posts_per_page' => esc_attr($limit)));
    while ($photos->have_posts()) {
        $photos->the_post();
        $term_list = wp_get_post_terms(get_the_ID(), 'type', array("fields" => "names"));
        $images = rwmb_meta('_jellythemes_project_images', 'type=plupload_image', get_the_ID());
        foreach ($images as $image) {
            $img = wp_get_attachment_image($image['ID'], 'full', false, array('class' => 'img-responsive'));
            $src = wp_get_attachment_image_src($image['ID'], 'full');
        }
        $return .= '<article class="' . implode(' ', get_post_class('entry')) . '">
			                                <a class="swipebox" href="' . $src[0] . '">
			                                ' . $img . '
			                                <span class="magnifier"></span>
			                                </a>
			                            </article>';
    }
    $return .= '</div>';
    return $return;
}
Esempio n. 2
0
 function shortcode_post_teacher($atts, $content)
 {
     $html = '<div class="tribe-events"><div class="fusion-posts-teacher fusion-blog-layout-grid fusion-blog-layout-grid-4 isotope"><div class="fusion-row">';
     $args = array('post_type' => 'post-k-teacher', 'posts_per_page' => 4);
     $the_query = new WP_Query($args);
     while ($the_query->have_posts()) {
         $the_query->the_post();
         $html .= '<article id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class('post fusion-post-grid')) . '"><div class="post-inner">';
         if (has_post_thumbnail()) {
             $html .= '<div class="entry-thumb">';
             $html .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_post_thumbnail(get_the_ID(), 'rt_thumb300x400') . '</a>';
             $html .= '</div>';
         }
         $html .= '<h3 class="entry-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></h3>';
         if (function_exists('get_field')) {
             $manifesto = get_field('manifesto');
             if (!empty($manifesto)) {
                 $html .= '<div class="entry-manifesto">';
                 $html .= $manifesto;
                 $html .= '</div>';
             }
         }
         $html .= '</div></article>';
     }
     $html .= '</div></div></div>';
     return $html;
 }
Esempio n. 3
0
 /**
  * Get Article
  *
  * Builds the post being displayed by the load_loop function adding clip formatting as required as well as relevant post classes
  *
  * @uses    pagelines_show_clip
  * @uses    post_header
  * @uses    post_entry
  *
  * @internal uses filter 'pagelines_get_article_post_classes'
  * @internal uses filter 'pageliens_get_article_output'
  */
 function get_article()
 {
     global $wp_query;
     global $post;
     /* clip handling */
     $clip = $this->pagelines_show_clip($this->count, $this->paged) ? true : false;
     $meta_mode = $this->section->opt('pl_meta_mode');
     $format = $clip ? 'clip' : 'feature';
     $clip_row_start = $this->clipcount % 2 == 0 ? true : false;
     $clip_right = ($this->clipcount + 1) % 2 == 0 ? true : false;
     $clip_row_end = $clip_right || $this->count == $this->post_count ? true : false;
     $post_type_class = $clip ? $clip_right ? 'clip clip-right' : 'clip' : 'fpost';
     $meta_mode_class = isset($meta_mode) && $meta_mode != '' ? 'meta-mode-' . $meta_mode : '';
     $pagelines_post_classes = apply_filters('pagelines_get_article_post_classes', sprintf('%s post-number-%s', $post_type_class, $this->count));
     $post_classes = join(' ', get_post_class($pagelines_post_classes));
     $wrap_type = $clip ? 'clip_box' : 'article-wrap';
     $wrap_start = $clip && $clip_row_start || !$clip ? sprintf('<div class="%s %s fix">', $wrap_type, $meta_mode_class) : '';
     $wrap_end = $clip && $clip_row_end || !$clip ? sprintf('</div>') : '';
     $author_tag = !$clip && $meta_mode == 'author' ? $this->get_author_tag() : '';
     $post_args = array('header' => $this->post_header($format), 'entry' => $this->post_entry(), 'classes' => $post_classes, 'pad-class' => $clip ? 'hentry-pad blocks' : 'hentry-pad', 'wrap-start' => $wrap_start, 'wrap-end' => $wrap_end, 'format' => $format, 'count' => $this->count);
     $post_args['markup-start'] = sprintf('%s<article class="%s" id="post-%s">%s<div class="wrp"><div class="%s">', $post_args['wrap-start'], $post_args['classes'], $post->ID, $author_tag, $post_args['pad-class']);
     $post_args['markup-end'] = sprintf('</div></div></article>%s', $post_args['wrap-end']);
     $original = join(array($post_args['markup-start'], $post_args['header'], $post_args['entry'], $post_args['markup-end']));
     echo apply_filters('pagelines_get_article_output', $original, $post, $post_args);
     // Count the clips
     if ($clip) {
         $this->clipcount++;
     }
     // Count the posts
     $this->count++;
 }
Esempio n. 4
0
 public function render($atts, $content = null)
 {
     $css = '';
     extract(shortcode_atts(array('css' => ''), $atts));
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class($css, ' '));
     $events = new WP_Query(array('post_type' => 'event', 'posts_per_page' => 4, 'order' => 'ASC', 'orderby' => 'event_when', 'meta_query' => array(array('key' => 'event_when', 'value' => current_time('timestamp'), 'compare' => '>'))));
     $output = '';
     if ($events->have_posts()) {
         $output .= '<div class="event_list_module ' . $css_class . '">';
         $output .= '<ul class="events_list clearfix">';
         while ($events->have_posts()) {
             $events->the_post();
             $output .= '<li id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class()) . '">';
             $output .= '<div class="event-content">';
             $output .= '<div class="event-date_wrapper">';
             $output .= '<div class="event_top"></div>';
             $output .= '<div class="event-date">';
             $output .= date('d', get_post_meta(get_the_ID(), 'event_when', true));
             $output .= '<span>' . date('F', get_post_meta(get_the_ID(), 'event_when', true)) . '</span>';
             $output .= '<div class="event-date-border"></div>';
             $output .= '</div>';
             $output .= '</div>';
             $output .= '<h5><a href="' . get_the_permalink() . '">' . get_the_title() . '</a></h5>';
             $output .= '<cite>' . get_post_meta(get_the_ID(), 'event_where', true) . '</cite>';
             $output .= '<a href="' . get_the_permalink() . '" class="button">' . __('More Details', STM_DOMAIN) . '</a>';
             $output .= '</div>';
             $output .= '</li>';
         }
         $output .= '</ul>';
         $output .= '</div>';
     }
     wp_reset_query();
     return $output;
 }
Esempio n. 5
0
 /**
  * Display widget content.
  *
  * @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)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, $this->defaults);
     $featured_page = new WP_Query(array('page_id' => $instance['page_id']));
     echo $before_widget . '<div class="feature-page">';
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     if ($featured_page->have_posts()) {
         while ($featured_page->have_posts()) {
             $featured_page->the_post();
             echo '<div class="' . implode(' ', get_post_class()) . '">';
             if (!empty($instance['show_title'])) {
                 printf('<h4 class="entry-title"><a href="%s" title="%s">%s</a></h4>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
             }
             //Show image
             if (!empty($instance['show_image'])) {
                 printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), calibrefx_get_image(array('format' => 'html', 'size' => $instance['image_size'])));
             }
             if (!empty($instance['show_content'])) {
                 if (empty($instance['content_limit'])) {
                     the_content($instance['more_text']);
                 } else {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 }
             }
             echo '</div><!--end post_class()-->' . "\n\n";
         }
     }
     echo '</div>' . $after_widget;
     wp_reset_query();
 }
Esempio n. 6
0
function get_post_classes($object, $field_name, $request)
{
    setup_get_field($object, $field_name, $request);
    $post_class = get_post_class();
    $post_class = join(' ', $post_class);
    return $post_class;
}
/**
 * Output pages defined in framework
 */
function grahlie_use_pages($class = null, $title, $thumbnail)
{
    $grahlie_values = get_option('grahlie_framework_values');
    $output = '';
    if (array_key_exists('use_pages', $grahlie_values) && $grahlie_values['use_pages'] == 'on' && array_key_exists('use_pages_count', $grahlie_values)) {
        for ($i = 1; $i <= $grahlie_values['use_pages_count']; $i++) {
            $page = get_post($grahlie_values['use_pages_select'][$i]);
            $size = 'size' . 12 / $grahlie_values['use_pages_count'];
            $id = get_post_class()[0];
            $type = get_post_class()[1];
            $class .= ' ' . $id . ' ' . $type . ' column';
            $output .= '<div id="' . $id . '" class="grahlieBox' . $class . ' ' . $size . '">';
            if ($thumb != '') {
                $thumb = get_the_post_thumbnail($page->ID);
                $output .= $thumb;
            }
            if ($title != '') {
                $output .= '<h2>' . $page->post_title . '</h2>';
            }
            if (empty($page->post_excerpt)) {
                $content = grahlie_content_excerpt_filter($page->post_content);
            } else {
                $content = $page->post_excerpt;
            }
            $output .= '<p>' . $content . '</p><a href="' . $page->post_name . '" class="btn btn-primary">Läs mer</a></div>';
        }
    }
    return $output;
}
Esempio n. 8
0
function wpsc_get_product_class($class, $post_id = null)
{
    if (!$post_id) {
        $post_id = wpsc_get_product_id();
    }
    return get_post_class($class, $post_id);
}
Esempio n. 9
0
 /**
  * Echo the widget content.
  *
  * @since 0.1.8
  *
  * @global WP_Query $wp_query Query object.
  * @global integer  $more
  *
  * @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)
 {
     //* Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     if (!empty($instance['url'])) {
         $instance['url'] = do_shortcode($instance['url']);
     }
     if (!empty($instance['image_url'])) {
         $instance['image_url'] = do_shortcode($instance['image_url']);
     }
     if (!empty($instance['description'])) {
         $instance['description'] = do_shortcode($instance['description']);
     }
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'] . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $args['after_title'];
     }
     genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
     if (!empty($instance['url'])) {
         echo '<a href="' . $instance['url'] . '" title="' . $instance['title'] . '" class="' . esc_attr($instance['image_alignment']) . '">' . '<img src="' . $instance['image_url'] . '" class="entry-image" itemprop="image" />' . '</a>';
     }
     if (!empty($instance['description'])) {
         echo genesis_html5() ? '<div class="entry-content">' : '';
         echo esc_html($instance['description']);
         echo genesis_html5() ? '</div>' : '';
     }
     genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
     echo $args['after_widget'];
 }
Esempio n. 10
0
    static function getWordpressData() {
        /**
         * Get all global page data
         */
        $blogDataParams = array(
            'url', 'wpurl', 'description', 'rdf_url' , 'rss_url', 'rss2_url'
            , 'atom_url', 'comments_atom_url', 'comments_rss2_url', 'pingback_url'
            , 'stylesheet_url', 'stylesheet_directory', 'template_directory'
            , 'template_url', 'admin_email', 'charset', 'html_type', 'version'
            , 'language', 'text_direction', 'name'
        );

        $blogData = array();

        foreach($blogDataParams as $blogDataParam) {
            $blogData[self::toCamelCase($blogDataParam)] = get_bloginfo($blogDataParam);
        }

        $blogData = array_merge($blogData, array(
            'title'            => wp_title(' | ', false, 'right') . get_bloginfo('name'),
            'archiveLinksHTML' => wp_get_archives('type=monthly&limit=5&format=link&echo=0'),
            'bodyClasses'      => self::getEchoFunctionContents('body_class'),
            'posts'            => array()
        ));

        /**
         * Get posts data
         */
        while (have_posts()) {
            the_post();
            
            $postId     = get_the_ID();

            // Get category data
            $categories = get_the_category();
            $categoryNames = array();
            foreach($categories as $category) {
                array_push($categoryNames, $category->cat_name);
            }

            // Add all relevant post data to the posts array
            array_push(
                $blogData['posts'],
                array_merge(
                    get_object_vars(get_post($postId)),
                    array(
                        'classes'       => get_post_class(),
                        'comments'      => get_comments(array('post_id' => $postId)),
                        'custom'        => get_post_custom(),
                        'permalink'     => get_permalink(),
                        'categories'    => $categories,
                        'categoryNames' => $categoryNames,
                        'categoriesStr' => implode(',', $categoryNames)
                    )
                )
            );
        }

        return $blogData;
    }
function sc_get_events_list($display = 'all', $category = null, $number = 5)
{
    $event_args = array('post_type' => 'sc_event', 'posts_per_page' => $number, 'meta_key' => 'sc_event_date_time', 'orderby' => 'meta_value_num', 'order' => 'asc', 'post_status' => 'publish');
    if ($display == 'past') {
        $event_args['meta_compare'] = '<';
        $event_args['order'] = 'desc';
    } else {
        if ($display == 'upcoming') {
            $event_args['meta_compare'] = '>=';
        }
    }
    if ($display != 'all') {
        $event_args['meta_value'] = time();
    }
    if (!is_null($category)) {
        $event_args['sc_event_category'] = $category;
    }
    $events = get_posts(apply_filters('sc_event_list_query', $event_args));
    ob_start();
    if ($events) {
        echo '<ul class="sc_events_list">';
        foreach ($events as $event) {
            echo '<li class="' . str_replace('hentry', '', implode(' ', get_post_class('sc_event', $event->ID))) . '">';
            do_action('sc_before_event_list_item', $event->ID);
            echo '<a href="' . get_permalink($event->ID) . '" class="sc_event_link">';
            echo '<span class="sc_event_title">' . get_the_title($event->ID) . '</span>';
            echo '</a>';
            do_action('sc_after_event_list_item', $event->ID);
            echo '</li>';
        }
        echo '</ul>';
    }
    return ob_get_clean();
}
Esempio n. 12
0
function theme_latest_news($atts, $content)
{
    global $themename;
    extract(shortcode_atts(array("count" => 2, "category" => "", "order" => "DESC"), $atts));
    query_posts(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'cat' => $category, 'order' => $order));
    $output = '<ul class="blog clearfix">';
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $post_classes = get_post_class("post");
            $output .= '<li class="';
            foreach ($post_classes as $key => $post_class) {
                $output .= $post_class . ($key + 1 < count($post_classes) ? ' ' : '');
            }
            $output .= '">
						<div class="comment_box">
							<div class="first_row">
								' . get_the_time("d") . '<span class="second_row">' . strtoupper(get_the_time("M")) . '</span>
							</div>';
            $comments_count = get_comments_number();
            $output .= '		<a class="comments_number" href="' . get_comments_link() . '" title="' . $comments_count . ($comments_count == 1 ? ' ' . __('Comment', $themename) : ' ' . __('Comments', $themename)) . '">' . $comments_count . ($comments_count == 1 ? ' ' . __('Comment', $themename) : ' ' . __('Comments', $themename)) . '</a>
						</div>
						<div class="post_content">';
            if (has_post_thumbnail()) {
                $output .= '<a class="post_image" href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_post_thumbnail(get_the_ID(), "blog-post-thumb", array("alt" => get_the_title(), "title" => "")) . '</a>';
            }
            $output .= '		<h2>
								<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a>
							</h2>
							<div class="text">
								' . apply_filters('the_excerpt', get_the_excerpt()) . '
							</div>
							<div class="post_footer">
								<ul class="categories">
									<li class="posted_by">' . __('Posted by', $themename) . ' <a class="author" href="' . get_the_author_link() . '" title="' . get_the_author() . '">' . get_the_author() . '</a></li>';
            $categories = get_the_category();
            foreach ($categories as $key => $category) {
                $output .= '<li>
											<a href="' . get_category_link($category->term_id) . '" ';
                if (empty($category->description)) {
                    $output .= 'title="' . sprintf(__('View all posts filed under %s', $themename), $category->name) . '"';
                } else {
                    $output .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
                }
                $output .= '>' . $category->name . '</a>
										</li>';
            }
            $output .= '			</ul>
								<a class="more icon_small_arrow margin_right_white" href="' . get_permalink() . '" title="' . __("More", $themename) . '">' . __("More", $themename) . '</a>
							</div>
						</div>
					</li>';
        }
    }
    $output .= '</ul>';
    //Reset Query
    wp_reset_query();
    return $output;
}
 /**
  * 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;
 }
Esempio n. 14
0
function get_post_data($post_object)
{
    global $post;
    $post = $post_object;
    setup_postdata($post);
    $post_class = get_post_class();
    $post_data = array('author' => get_the_author(), 'author_url' => get_author_posts_url(get_the_author_meta('ID')), 'classes' => join(' ', $post_class), 'content' => get_the_content(), 'date' => get_the_date(), 'datetime' => get_post_time('c', true), 'excerpt' => get_the_excerpt(), 'json_url' => '/wp-json/wp/v2/posts/' . get_the_ID(), 'title' => get_the_title(), 'link' => str_replace(home_url(), '', get_the_permalink()));
    return $post_data;
}
 function widget($args, $instance)
 {
     /** defaults */
     $instance = wp_parse_args($instance, array('title' => '', 'posts_per_page' => 10));
     extract($args);
     echo $before_widget;
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $toggle = '';
     /** for left/right class */
     $query_args = array('post_type' => 'listing', 'posts_per_page' => $instance['posts_per_page'], 'paged' => get_query_var('paged') ? get_query_var('paged') : 1);
     query_posts($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             //* initialze the $loop variable
             $loop = '';
             //* Pull all the listing information
             $custom_text = genesis_get_custom_field('_listing_text');
             $price = genesis_get_custom_field('_listing_price');
             $address = genesis_get_custom_field('_listing_address');
             $city = genesis_get_custom_field('_listing_city');
             $state = genesis_get_custom_field('_listing_state');
             $zip = genesis_get_custom_field('_listing_zip');
             $loop .= sprintf('<a href="%s">%s</a>', get_permalink(), genesis_get_image(array('size' => 'properties')));
             if ($price) {
                 $loop .= sprintf('<span class="listing-price">%s</span>', $price);
             }
             if (strlen($custom_text)) {
                 $loop .= sprintf('<span class="listing-text">%s</span>', esc_html($custom_text));
             }
             if ($address) {
                 $loop .= sprintf('<span class="listing-address">%s</span>', $address);
             }
             if ($city || $state || $zip) {
                 //* count number of completed fields
                 $pass = count(array_filter(array($city, $state, $zip)));
                 //* If only 1 field filled out, no comma
                 if (1 == $pass) {
                     $city_state_zip = $city . $state . $zip;
                 } elseif ($city) {
                     $city_state_zip = $city . ", " . $state . " " . $zip;
                 } else {
                     $city_state_zip = $city . " " . $state . ", " . $zip;
                 }
                 $loop .= sprintf('<span class="listing-city-state-zip">%s</span>', trim($city_state_zip));
             }
             $loop .= sprintf('<a href="%s" class="more-link">%s</a>', get_permalink(), __('View Listing', 'agentpress-listings'));
             $toggle = $toggle == 'left' ? 'right' : 'left';
             /** wrap in post class div, and output **/
             printf('<div class="%s"><div class="widget-wrap"><div class="listing-wrap">%s</div></div></div>', join(' ', get_post_class($toggle)), apply_filters('agentpress_featured_listings_widget_loop', $loop));
         }
     }
     wp_reset_query();
     echo $after_widget;
 }
Esempio n. 16
0
    /**
     * Render the shortcode
     * @param  array $args	 Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string		  HTML output
     */
    function render($atts, $content = '')
    {
        $html = '';
        extract(shortcode_atts(array('posts_per_page' => '5', 'column' => '4', 'margin_item' => '50', 'autoplay' => 'yes', 'touch_scroll' => 'yes', 'navigation' => '1'), $atts));
        // wp_enqueue_style( 'rt-teacher' );
        $html = '<div class="fusion-image-carousel-fixed carousel-teacher">';
        $html .= '<div class="fusion-carousel" 
						data-autoplay    = "' . $autoplay . '" 
						data-columns     = "' . $column . '" 
						data-itemmargin  = "' . $margin_item . '" 
						data-touchscroll = "' . $touch_scroll . '">';
        $html .= '<div class="fusion-carousel-positioner">';
        $html .= '<div class="fusion-carousel-wrapper">';
        $html .= '<ul class="fusion-posts-teacher fusion-carousel-holder">';
        $args = array('post_type' => 'post-k-teacher', 'posts_per_page' => $posts_per_page);
        $the_query = new WP_Query($args);
        // The Loop
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                $html .= '<li id="post-' . get_the_ID() . '" class="' . implode(' fusion-carousel-item ', get_post_class('post fusion-post-grid')) . '" >';
                $html .= '<div class="post-inner">';
                if (has_post_thumbnail()) {
                    $html .= '<div class="entry-thumb">';
                    $html .= '<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_post_thumbnail(get_the_ID(), 'rt_thumb300x400') . '</a>';
                    $html .= '</div>';
                }
                $html .= '<h3 class="entry-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></h3>';
                if (function_exists('get_field')) {
                    $manifesto = get_field('manifesto');
                    if (!empty($manifesto)) {
                        $html .= '<div class="entry-manifesto">';
                        $html .= $manifesto;
                        $html .= '</div>';
                    }
                }
                $html .= '</div>';
                $html .= '</li>';
            }
        }
        $html .= '</ul>';
        $html .= '</div>';
        if ($navigation == '1') {
            $html .= '<div class="wrap-carousel-navigation">';
            $html .= '<div class="fusion-carousel-nav">';
            $html .= '<span class="fusion-nav-prev">';
            $html .= '</span>';
            $html .= '<span class="fusion-nav-next">';
            $html .= '</span>';
            $html .= '</div>';
            $html .= '</div>';
        }
        $html .= '</div>';
        $html .= '</div>';
        $html .= '</div>';
        return $html;
    }
Esempio n. 17
0
    public function aesop_timeline_loader()
    {
        // allow theme developers to determine the offset amount
        $timelineOffset = apply_filters('aesop_timeline_scroll_offset', 0);
        // filterable content class
        $postClass = get_post_class();
        if (in_array('aesop-entry-content', $postClass)) {
            $contentClass = '.aesop-entry-content';
        } else {
            $contentClass = apply_filters('aesop_chapter_scroll_container', '.entry-content');
        }
        // filterable target class
        $appendTo = apply_filters('aesop_timeline_scroll_nav', '.aesop-timeline');
        ?>
			<!-- Aesop Timeline -->
			<script>
			jQuery(document).ready(function($){

				contentClass = '<?php 
        echo esc_attr($contentClass);
        ?>
';
				if (jQuery(contentClass).length==0) {
					contentClass = '.aesop-entry-content';
				}
				
				$('body').append('<div class="aesop-timeline"></div>');

				$(contentClass).scrollNav({
				    sections: '.aesop-timeline-stop',
				    arrowKeys: true,
				    insertTarget: '<?php 
        echo esc_attr($appendTo);
        ?>
',
				    insertLocation: 'appendTo',
				    showTopLink: false,
				    showHeadline: false,
				    scrollOffset: <?php 
        echo (int) $timelineOffset;
        ?>
,
				});

				$('.aesop-timeline-stop').each(function(){
					var label = $(this).attr('data-title');
					$(this).text(label);
				});

			});

			</script>

		<?php 
    }
 public function handleShortcode($atts, $content = null)
 {
     extract(shortcode_atts(array('group' => '', 'width' => 3, 'medium_width' => 6, 'small_width' => 12, 'target' => '_self', 'class' => ''), $atts));
     // get first if none was provided
     if (empty($group)) {
         $cats = array();
         foreach ((array) get_terms('coll-clients-group', array('hide_empty' => false)) as $cat) {
             $cats[] = $cat->slug;
         }
         $group = implode($cats, ', ');
     } else {
     }
     $Qargs = array('post_type' => 'coll-clients', 'coll-clients-group' => $group, 'posts_per_page' => -1);
     // build it
     $output = '';
     $output .= '<div class="coll-shortcode-clients row collapse' . $class . '">';
     // items
     $loop = new WP_Query($Qargs);
     while ($loop->have_posts()) {
         $loop->the_post();
         global $post;
         // get info
         $class = join(" ", get_post_class());
         $class .= ' large-' . $width . ' medium-' . $medium_width . ' small-' . $small_width . ' columns';
         $link_url = get_post_meta(get_the_ID(), 'coll_link_url', true);
         $tmb_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
         // build
         $output .= '<article id="' . $post->post_name . '" class="' . $class . '">';
         $output .= '<div class="wrapper">';
         if (!empty($link_url)) {
             $output .= '<a  class="link" href="' . $link_url . '" target="' . $target . '">';
             $output .= '<img  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
                               class="image js-coll-lazy"
                               width="' . $tmb_data[1] . '"
                               height="' . $tmb_data[2] . '"
                               data-coll-src="' . $tmb_data[0] . '"
                               alt="' . get_the_title($post->ID) . '" />';
             $output .= '</a>';
         } else {
             $output .= '<img  src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII="
                               class="image js-coll-lazy"
                               width="' . $tmb_data[1] . '"
                               height="' . $tmb_data[2] . '"
                               data-coll-src="' . $tmb_data[0] . '"
                               alt="' . get_the_title($post->ID) . '" />';
         }
         $output .= '</div>';
         $output .= '</article>';
     }
     //end items
     $output .= '</div>';
     // end team ;
     wp_reset_postdata();
     return $output;
 }
 /**
  * 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;
     //* Set up the author bio
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $query_args = array('post_type' => $instance['post_type'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
     //* Exclude displayed IDs from this loop?
     if ($instance['exclude_displayed']) {
         $query_args['post__not_in'] = (array) $_genesis_displayed_ids;
     }
     $wp_query = new WP_Query($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             global $post;
             //* Custom Meta Data
             $sermon_speaker = get_post_meta($post->ID, '_community_pro_speaker_field', true);
             $sermon_date = date("d M", strtotime(get_post_meta($post->ID, '_community_pro_sermon_date_field', true)));
             $_genesis_displayed_ids[] = get_the_ID();
             genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
             echo '<div class="sermon-info">';
             if (!empty($sermon_date)) {
                 echo '<div class="sermon-date">' . $sermon_date . '</div>';
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '<header class="entry-header">' : '';
             }
             if (!empty($instance['show_title'])) {
                 if (genesis_html5()) {
                     printf('<h2 class="entry-title"><a href="%s" title="%s">%s</a></h4>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 } else {
                     printf('<h2 class="entry-title"><a href="%s" title="%s">%s</a></h4>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 }
             }
             if ($instance['show_title']) {
                 echo genesis_html5() ? '</header>' : '';
             }
             if (!empty($sermon_speaker)) {
                 //* Make date look pretty
                 echo '<div class="sermon-speaker"><span class="dashicons dashicons-admin-users"></span> ' . $sermon_speaker . '</div>';
             }
             echo '</div>';
             genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
         }
     }
     //* Restore original query
     wp_reset_query();
     echo $after_widget;
 }
 public function handleShortcode($atts, $content = null)
 {
     extract(shortcode_atts(array('group' => '', 'width' => 3, 'medium_width' => 6, 'image_type' => '', 'name_color' => '#000', 'class' => ''), $atts));
     // get first if none was provided
     if (empty($group)) {
         $cats = array();
         foreach ((array) get_terms('coll-service-group', array('hide_empty' => false)) as $cat) {
             $cats[] = $cat->slug;
         }
         $group = implode($cats, ', ');
     } else {
     }
     $Qargs = array('post_type' => 'coll-service', 'coll-service-group' => $group, 'posts_per_page' => -1);
     // build it
     $output = '';
     $output .= '<div class="coll-shortcode-services row ' . $class . '">';
     // items
     $loop = new WP_Query($Qargs);
     while ($loop->have_posts()) {
         $loop->the_post();
         global $post;
         // get info
         //$columns = 12 / $columns;
         $class = join(" ", get_post_class());
         $class .= ' large-' . $width . ' medium-' . $medium_width . ' columns';
         $tmb_html = '';
         if (has_post_thumbnail($post->ID)) {
             $data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
             if ($image_type == 'round') {
                 $tmb_html .= '<div  class="coll-image-wrapper round">';
             } else {
                 $tmb_html .= '<div class="coll-image-wrapper">';
             }
             $tmb_html .= '<img  class="image"
                                 src="' . $data[0] . '"
                                 alt="' . get_the_title($post->ID) . '" />';
             $tmb_html .= '</div>';
         }
         // build
         $output .= '<article id="' . $post->post_name . '" class="' . $class . '" >';
         $output .= '<div class="js-coll-inner">';
         $output .= $tmb_html;
         $output .= '<div class="title">';
         $output .= '<h4 class="text" style="color : ' . $name_color . '">' . get_the_title() . '</h4>';
         $output .= '</div>';
         $output .= '<div class="content">' . MorpheusUtils::get_the_content(get_the_ID()) . '</div>';
         $output .= '</div>';
         $output .= '</article>';
     }
     //end items
     $output .= '</div>';
     // end team ;
     wp_reset_postdata();
     return $output;
 }
/**
 * FAQ loop.
 * We're replacing the Genesis loop with our own.
 */
function rbfaq_archive_loop()
{
    $count = 0;
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            //* Set up the count
            $count++;
            //* Figure out what class to apply to the image
            //* If the image
            if ($count % 2 == 0) {
                $imageclass = 'member-image member-image-left';
            } else {
                $imageclass = 'member-image member-image-right';
            }
            printf('<div class="%s">', implode(' ', get_post_class('member-section')));
            /**
             * Output the image
             * We're only going to link the image if there's something to link to
             */
            if (get_the_content() && ($image = genesis_get_image('format=url&size=member-image'))) {
                printf('<div class="portfolio-image"><a href="%s" rel="bookmark"><img class="%s" src="%s" alt="%s" /></a></div>', get_permalink(), $imageclass, $image, the_title_attribute('echo=0'));
            } elseif ($image = genesis_get_image('format=url&size=member-image')) {
                printf('<div class="portfolio-image"><img class="%s" src="%s" alt="%s" /></div>', $imageclass, $image, the_title_attribute('echo=0'));
            }
            echo '<div class="member-content">';
            edit_post_link('Edit this member', '<small>', '</small>', '');
            //* Only link the title if there's some content to link to
            if (get_the_content()) {
                printf('<h2 class="entry-title"><a href="%s">%s</a></h2>', get_the_permalink(), get_the_title());
            } else {
                printf('<h2 class="entry-title">%s</h2>', get_the_title());
            }
            //* Add the member's title
            global $post;
            $title = get_post_meta(get_the_ID(), '_rbm_members_title', true);
            if ($title) {
                printf('<h4 class="member-subtitle">%s</h4>', $title);
            }
            echo '<p>';
            the_excerpt_max_charlength(250);
            echo '</p>';
            if (get_the_content()) {
                printf('<a class="button" href="%s">Read more</a>', get_the_permalink());
            }
            echo '</div>';
            // .member-content
            echo '</div>';
            // the post_class() div
        }
        // end while
    }
    // end if
}
 /**
  * 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;
     extract($args);
     //* Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     echo $before_widget;
     //* Set up the author bio
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     $wp_query = new WP_Query(array('page_id' => $instance['page_id']));
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
             $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-page-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
             if ($instance['show_image'] && $image) {
                 printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), $image);
             }
             if (!empty($instance['show_title'])) {
                 if (genesis_html5()) {
                     printf('<header class="entry-header"><h2 class="entry-title"><a href="%s" title="%s">%s</a></h2></header>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 } else {
                     printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 }
             }
             if (!empty($instance['show_content'])) {
                 echo genesis_html5() ? '<div class="entry-content">' : '';
                 if (empty($instance['content_limit'])) {
                     global $more;
                     $more = 0;
                     the_content($instance['more_text']);
                 } else {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 }
                 echo genesis_html5() ? '</div>' : '';
             }
             if (!empty($instance['custom_text'])) {
                 $text = wp_kses_post($instance['custom_text']);
                 echo '<div class="custom-text">';
                 echo $instance['filter'] ? wpautop($text) : $text;
                 if (!empty($instance['more_text'])) {
                     echo '<span class="more-link"><a href="' . get_permalink($instance['page_id']) . '">' . $instance['more_text'] . '</a></span>';
                 }
                 echo '</div>';
             }
             genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
         }
     }
     //* Restore original query
     wp_reset_query();
     echo $after_widget;
 }
Esempio n. 23
0
 public static function single_content_main()
 {
     $jobTitle = get_field('job_title');
     echo '<article class="' . join(' ', get_post_class('medium-8 columns')) . '">';
     the_title('<h1>', '</h1>');
     if ($jobTitle) {
         echo '<h3 class="fp-team-single-job-title">' . esc_html($jobTitle) . '</h3>';
     }
     the_content();
     echo '</article>';
 }
 public function __construct($data)
 {
     parent::__construct($data);
     $this->name = 'postclass';
     $this->tag = isset($data['tag']) ? $data['tag'] : 'article';
     $this->tag_type = 'split';
     $classes = array();
     if (isset($data['attributes']['class'])) {
         $classes = $data['attributes']['class'];
     }
     $this->attributes['class'] = get_post_class($classes, $this->post_object->ID);
 }
    function render()
    {
        ob_start();
        ?>

        <div class="<?php 
        echo $this->get_module_classes(array_merge(get_post_class()));
        ?>
" <?php 
        echo $this->get_item_scope();
        ?>
>
            <div class="item-details">
                <?php 
        echo $this->get_title();
        ?>

                <div class="td-module-meta-info">
	                <?php 
        if (td_util::get_option('tds_category_module_15') == 'yes') {
            echo $this->get_category();
        }
        ?>
                    <?php 
        echo $this->get_author();
        ?>
                    <?php 
        echo $this->get_date();
        ?>
                    <?php 
        echo $this->get_comments();
        ?>
                </div>

                <?php 
        echo $this->get_image('td_696x0');
        ?>

	            <div class="td-post-text-content td-post-content">
		            <?php 
        echo $this->get_content();
        ?>
	            </div>
            </div>

            <?php 
        echo $this->get_item_scope_meta();
        ?>
        </div>

        <?php 
        return ob_get_clean();
    }
 function widget($args, $instance)
 {
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = null;
     }
     extract($args, EXTR_SKIP);
     echo $before_widget;
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     $args = array('posts_per_page' => $instance['count'] ? intval($instance['count']) : 0, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true);
     if ($instance['category']) {
         $args['category_name'] = $instance['category'];
     }
     $r = new WP_Query(apply_filters('widget_posts_args', $args));
     $output = false;
     if ($r->have_posts()) {
         $output .= '<div class="Recent_posts">';
         $output .= '<ul>';
         while ($r->have_posts()) {
             $r->the_post();
             $class = false;
             if (!has_post_thumbnail(get_the_ID())) {
                 if (!in_array(get_post_format(), array('quote', 'link'))) {
                     $class = 'no-img';
                 }
             }
             $output .= '<li class="' . implode(' ', get_post_class($class)) . '">';
             $output .= '<a href="' . get_permalink() . '">';
             $output .= '<div class="photo">';
             if (has_post_thumbnail()) {
                 $output .= get_the_post_thumbnail(get_the_ID(), 'blog-navi', array('class' => 'scale-with-grid'));
             }
             if (comments_open()) {
                 $output .= '<span class="c">' . get_comments_number() . '</span>';
             }
             $output .= '</div>';
             $output .= '<div class="desc">';
             $output .= '<h6>' . get_the_title() . '</h6>';
             $output .= '<span class="date"><i class="icon-clock"></i>' . get_the_date() . '</span>';
             $output .= '</div>';
             $output .= '</a>';
             $output .= '</li>';
         }
         wp_reset_postdata();
         $output .= '</ul>';
         $output .= '</div>' . "\n";
     }
     echo $output;
     echo $after_widget;
 }
Esempio n. 27
0
function sys_blog($atts, $content = null)
{
    extract(shortcode_atts(array('cat' => '2', 'limit' => '5', 'pagination' => 'true', 'postmeta' => 'true'), $atts));
    global $atp_readmoretxt, $post;
    $out = '';
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $query = array('category_name' => $cat, 'showposts' => $limit, 'paged' => $paged);
    query_posts($query);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $format = get_post_format($post->ID);
            if (false === $format) {
                $format = 'standard';
            }
            $out .= '<div class="' . join(' ', get_post_class('post', get_the_ID())) . '" id="post-' . get_the_ID() . '">';
            $out .= '<div class="post_content">';
            ob_start();
            $out .= get_template_part('includes/' . $format);
            $out .= ob_get_contents();
            ob_end_clean();
            if ($format != 'link' && $format != 'quote' && $format != 'aside') {
                $out .= '<h2 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark" title="' . sprintf(__("Permanent Link to %s", 'THEME_FRONT_SITE'), esc_attr(get_the_title())) . '">' . get_the_title() . '</a></h2>';
            }
            if ($postmeta == "true") {
                $out .= '<div class="post-info">';
                $out .= atp_generator('postmetaStyle');
                $out .= '</div>';
            }
            if ($format != 'quote') {
                $out .= '<div class="post-entry">';
                $out .= '<p>' . get_the_excerpt() . '</p>';
                if ($format != 'quote' && $format != 'link') {
                    $out .= '<a href="' . get_permalink() . '" class="more-link">' . atp_localize($atp_readmoretxt, '<span>', '</span>') . '</a>';
                }
                $out .= '</div>';
            }
            $out .= '</div>';
            $out .= '</div>';
        }
        if (!function_exists('atp_pagination')) {
            if ($pagination == "true") {
                if (function_exists('atp_pagination')) {
                    $out .= atp_pagination();
                }
            }
        }
        wp_reset_query();
    }
    return $out;
}
 /**
  * Echo the widget content.
  *
  * @since 0.2.0
  *
  * @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;
     extract($args);
     //* Merge with defaults
     $instance = wp_parse_args((array) $instance, $this->defaults);
     echo $before_widget;
     //* Set up the widget title
     if (!empty($instance['title'])) {
         echo '<h2 class="widget-title widgettitle">' . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . '</h2>';
     }
     $query_args = array('post_type' => 'awp-community', 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']);
     $wp_query = new WP_Query($query_args);
     if (have_posts()) {
         while (have_posts()) {
             the_post();
             genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry'));
             $image = genesis_get_image(array('format' => 'html', 'size' => $instance['image_size'], 'context' => 'featured-community-widget', 'attr' => genesis_parse_attr('entry-image-widget')));
             if ($instance['show_image'] && $image) {
                 printf('<div class="awp-community-image"><a href="%s" title="%s" class="%s">%s</a></div>', get_permalink(), the_title_attribute('echo=0'), 'awp-community-link', $image);
             }
             if ($instance['show_title']) {
                 echo '<header class="entry-header">';
                 printf('<h3 class="entry-title"><a href="%s" title="%s">%s</a></h3>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
                 echo '</header>';
             }
             if (!empty($instance['show_content'])) {
                 echo '<div class="entry-content">';
                 if ('excerpt' == $instance['show_content']) {
                     $current_excerpt = get_the_excerpt();
                     echo $current_excerpt;
                     //the_excerpt();
                 } elseif ('content-limit' == $instance['show_content']) {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 } else {
                     global $more;
                     $orig_more = $more;
                     $more = 0;
                     the_content(esc_html($instance['more_text']));
                     $more = $orig_more;
                 }
                 echo '</div>';
             }
             genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>'));
         }
     }
     //* Restore original query
     wp_reset_query();
     echo $after_widget;
 }
Esempio n. 29
0
 /**
  * Shortcode: educator_courses.
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function educator_courses_shortcode($atts, $content = null)
 {
     $atts = shortcode_atts(array('show_price' => 1, 'ids' => '', 'number' => 15, 'categories' => null), $atts);
     $output = '<div class="courses-carousel owl-carousel">';
     $params = array('post_type' => 'ib_educator_course', 'orderby' => 'menu_order', 'posts_per_page' => intval($atts['number']));
     if ($atts['ids']) {
         $ids = explode(' ', $atts['ids']);
         $params['post__in'] = array();
         foreach ($ids as $id) {
             $params['post__in'][] = intval($id);
         }
         $params['posts_per_page'] = -1;
         $params['orderby'] = 'post__in';
     }
     if ($atts['categories']) {
         $categories = explode(' ', $atts['categories']);
         foreach ($categories as $key => $term_id) {
             $categories[$key] = intval($term_id);
         }
         $params['tax_query'] = array(array('taxonomy' => 'ib_educator_category', 'field' => 'term_id', 'terms' => $categories));
     }
     $query = new WP_Query($params);
     if ($query->have_posts()) {
         $course_id = 0;
         while ($query->have_posts()) {
             $query->the_post();
             $course_id = get_the_ID();
             $output .= '<article class="' . esc_attr(implode(' ', get_post_class('post-grid'))) . '">';
             if (has_post_thumbnail()) {
                 $output .= '<div class="post-thumb"><a href="' . esc_url(get_permalink()) . '">' . get_the_post_thumbnail($course_id, 'ib-educator-grid') . '</a></div>';
             }
             $output .= '<div class="post-body">';
             $output .= '<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '">' . the_title('', '', false) . '</a></h2>';
             if (1 == $atts['show_price'] && 'closed' != ib_edu_registration($course_id)) {
                 $output .= '<div class="price">' . ib_edu_format_course_price(ib_edu_get_course_price($course_id)) . '</div>';
             }
             ob_start();
             the_excerpt();
             $output .= '<div class="post-excerpt">' . ob_get_clean() . '</div>';
             $output .= '</div>';
             if (function_exists('educator_course_meta')) {
                 $output .= '<footer class="post-meta">' . educator_course_meta($course_id, array('num_lessons', 'difficulty')) . educator_share('menu') . '</footer>';
             }
             $output .= '</article>';
         }
         wp_reset_postdata();
     }
     $output .= '</div>';
     return $output;
 }
Esempio n. 30
0
function thesis_post_box($classes = '', $post_count = false)
{
    $post_image = thesis_post_image_info('image');
    thesis_hook_before_post_box($post_count);
    echo "\t\t\t<div class=\"" . join(' ', get_post_class($classes)) . "\" id=\"post-" . get_the_ID() . "\">\n";
    thesis_hook_post_box_top($post_count);
    thesis_headline_area($post_count, $post_image);
    echo "\t\t\t\t<div class=\"format_text entry-content\">\n";
    thesis_post_content($post_count, $post_image);
    echo "\t\t\t\t</div>\n";
    thesis_hook_post_box_bottom($post_count);
    echo "\t\t\t</div>\n\n";
    thesis_hook_after_post_box($post_count);
}