function do_binding($response, $data) { $mode = $data['mode']; $value = $data['value']; $id = $data['pageID']; $args = isset($data['args']) ? $data['args'] : array(); global $post; if (isset($args['id'])) { $post = get_post($args['id']); } else { $post = get_post($id); } if ($mode == 'media') { $media_args = array('thumb-size' => $value); $media_args = wp_parse_args($args, $media_args); $response['template'] = pagelines_media($media_args); } elseif ($mode == 'shortcodes') { $response['template'] = stripslashes_deep(do_shortcode($value)); //global $pl_shortcode_engine; //$response['engine'] = array( 'scripts' => $pl_shortcode_engine->scripts, 'styles' => $pl_shortcode_engine->styles ); } elseif ($mode == 'autop') { $response['template'] = do_shortcode(wpautop($value)); } elseif ($mode == 'sidebar') { $response['template'] = pl_draw_sidebar($value); } elseif ($mode == 'menu') { $menu_args = array('menu' => $data['value']); $menu_args = wp_parse_args($args, $menu_args); $response['template'] = pl_nav($menu_args); } else { $response = apply_filters('pl_binding_' . $mode, $response, $data); } return $response; }
function loop() { $count = 0; global $plpg; if (have_posts()) { while (have_posts()) { the_post(); $count++; $format = get_post_format(); $linkbox = $format == 'quote' || $format == 'link' ? true : false; $class = array(); $postlist = $plpg->is_blog_page_type() ? true : false; $class[] = is_archive() || is_search() || is_home() ? 'multi-post' : ''; $class[] = !$postlist ? 'standard-page' : ''; $class[] = is_single() ? 'single-post' : ''; $class[] = 'pl-border'; $class[] = 'pl-new-loop'; $gallery_format = get_post_meta(get_the_ID(), '_pagelines_gallery_slider', true); $class[] = !empty($gallery_format) ? 'use-flex-gallery' : ''; $thumb_size = pl_setting('thumb_size') ? pl_setting('thumb_size') : 'landscape-thumb'; $classes = apply_filters('pagelines_get_article_post_classes', join(" ", $class)); ?> <article id="post-<?php the_ID(); ?> " <?php post_class($classes); ?> > <?php if ($postlist) { echo '<div class="metahead">'; if (get_post_type() != 'page') { echo do_shortcode('[pl_author_avatar size="80"][post_author_posts_link class="pl-border"][pl_karma]'); } else { printf('<div class="metaicon"><i class="icon icon-file icon-3x"></i></div>'); } echo '</div>'; } if (!is_singular() && !$this->opt('post_media_hide')) { printf('<div class="metamedia">%s</div>', pagelines_media(array('thumb-size' => $thumb_size))); } ?> <?php if (!$linkbox) { ?> <header class="entry-header"> <?php if (is_single()) { the_title('<h2 class="entry-title">', '</h2>'); } elseif (!is_page()) { the_title('<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>'); } $meta = pl_setting('metabar_standard') ? pl_setting('metabar_standard') : 'Posted [post_date] · [post_comments] [post_edit]'; if ($meta && !is_page() && get_post_type() != 'page') { printf('<div class="metabar"> %s </div>', do_shortcode($meta)); } ?> </header><!-- .entry-header --> <?php } ?> <div class="entry-content"> <?php if (is_single() || is_page()) { printf('<div class="metamedia">%s</div>', pagelines_media(array('thumb-size' => $thumb_size))); the_content(__('Continue reading <span class="meta-nav">→</span>', 'pagelines')); wp_link_pages(array('before' => '<div class="page-links"><span class="page-links-title">' . __('Pages:', 'pagelines') . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); } elseif (!$linkbox) { the_excerpt(); printf('<div class="continue_reading_link"><a class="btn" href="%s" title="%s %s">%s</a></div>', get_permalink(), __("Read More", 'pagelines'), the_title_attribute(array('echo' => 0)), __('Read More <i class="icon icon-angle-right"></i>', 'pagelines')); } ?> </div><!-- .entry-content --> </article><!-- #post-## --> <?php } } else { $this->posts_404(); } }