Example #1
0
 * For example, it puts together the home page when no home.php file exists.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Twelve Child - Twenty_Twelve 
 * @since Twenty Twelve 1.0
 */
get_header(webcomic);
?>

<div id="webcomic-display" class="webcomic-display-wrapper">
	<?php 
$webcomics = false;
if (get_theme_mod('webcomic_home_order', 'DESC') and !is_paged()) {
    $webcomics = new WP_Query(array('order' => get_theme_mod('webcomic_home_order', 'DESC'), 'post_type' => get_theme_mod('webcomic_home_collection', '') ? get_theme_mod('webcomic_home_collection', '') : get_webcomic_collections(), 'posts_per_page' => 1));
}
if ($webcomics and !get_theme_mod('webcomic_content', false) and $webcomics->have_posts()) {
    while ($webcomics->have_posts()) {
        $webcomics->the_post();
        $compassus = get_post_meta(get_the_ID(), "is_compassus_webcomic", true);
        //var_dump($compassus);
        if ($compassus == true) {
            get_template_part('webcomic/display', "compassus");
        } else {
            get_template_part('webcomic/display', get_post_type());
        }
        ?>
				
				<div id="webcomic-display-article" class="webcomic-display-article-wrapper">
				<?php 
Example #2
0
}
?>

<div id="primary" class="site-content full-width">
	<div id="content" role="main">
		<?php 
get_template_part('webcomic/content', 'webcomicArchive');
?>
	</div><!-- #content -->
	
	<div id="anual-archive" class="webcomic-archive">
		
		<ul class="webcomic-terms">	
		<?php 
$characterFilter = get_query_var("term");
$postTypeList = get_webcomic_collections();
rsort($postTypeList);
$storylineObj = array();
foreach ($postTypeList as $x) {
    $args = get_taxonomies(array("name" => $x . "_storyline"));
    $storylineObj[$x] = get_terms($args);
    rsort($storylineObj[$x]);
}
//var_dump($storylineObj);
?>
	
			<?php 
foreach ($storylineObj as $postType => $x) {
    ?>
				<?php 
    foreach ($x as $storyline) {
Example #3
0
/** ENTRY META
 * Prints HTML with meta information for the categories, tags.
 *
 * @since Twenty Fifteen 1.0
 */
function twentyfifteen_entry_meta()
{
    if (is_sticky() && is_home() && !is_paged()) {
        printf('<span class="sticky-post">%s</span>', __('Featured', 'twentyfifteen'));
    }
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentyfifteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    $okArray = array('attachment', "post");
    $webcomicsPostType = get_webcomic_collections();
    foreach ($webcomicsPostType as $webcomic) {
        array_push($okArray, $webcomic);
    }
    if (in_array(get_post_type(), $okArray)) {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        if (get_the_time('U') !== get_the_modified_time('U')) {
            $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
        }
        $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
        printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'twentyfifteen'), esc_url(get_permalink()), $time_string);
    }
    if ('post' == get_post_type()) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
        $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
        if ($categories_list && twentyfifteen_categorized_blog()) {
            printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $categories_list);
        }
        $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'twentyfifteen'));
        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.', 'twentyfifteen'), $tags_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.', 'twentyfifteen'), esc_url(wp_get_attachment_url()), $metadata['width'], $metadata['height']);
    }
    if (in_array(get_post_type(), $webcomicsPostType)) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'twentyfifteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
        $collection_list = WebcomicTag::get_the_webcomic_collection_list(0, "", __(', ', 'twentytwelve'));
        $id = get_the_ID();
        $storylineObj = wp_get_object_terms($id, get_post_type() . "_storyline");
        $isChild = false;
        $parentStory;
        foreach ($storylineObj as $storyline) {
            if ($storyline->parent != 0) {
                $isChild = true;
                $parentStory = get_term_by("id", $storyline->parent, get_post_type() . "_storyline");
            }
        }
        //var_dump($collection_list, $storylineObj, $isChild,$parentStory);
        if ($isChild) {
            $parentName = $parentStory->name;
            $storyline_list = WebcomicTag::get_the_webcomic_term_list(0, 'storyline', "<a href='" . get_term_link($parentStory) . "'>" . $parentName . "</a> &gt ", __(', ', 'twentytwelve'));
        } else {
            $storyline_list = WebcomicTag::get_the_webcomic_term_list(0, 'storyline', "", __(', ', 'twentytwelve'));
        }
        if ($collection_list && $storyline_list) {
            printf('<br><span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s > %3$s</span><br>', _x('Categories', 'Used before category names.', 'twentyfifteen'), $collection_list, $storyline_list);
        }
        $character_list = WebcomicTag::get_the_webcomic_term_list(0, 'character', '', __(', ', 'twentytwelve'));
        if ($character_list) {
            printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span><br>', _x('Tags', 'Used before tag names.', 'twentyfifteen'), $character_list);
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(__('Leave a comment', 'twentyfifteen'), __('1 Comment', 'twentyfifteen'), __('% Comments', 'twentyfifteen'));
        echo '</span>';
    }
}
Example #4
0
 /**
  * Handle infinite scroll.
  * 
  * @hook wp_loaded
  */
 public function wp_loaded()
 {
     if (isset($_POST['webcomic-infinite'])) {
         $collections = get_webcomic_collections();
         $webcomics = new WP_Query(array('posts_per_page' => 2, 'post_type' => in_array($_POST['collection'], $collections) ? $_POST['collection'] : $collections, 'offset' => (int) $_POST['offset'], 'order' => in_array($_POST['order'], array('ASC', 'DESC')) ? $_POST['order'] : 'DESC'));
         if ($webcomics->have_posts()) {
             $webcomics->the_post();
             if (!locate_template(array('webcomic/infinite.php'), true)) {
                 require self::$dir . '-/php/integrate/infinite.php';
             }
         }
         if (2 > $webcomics->post_count) {
             if (!locate_template(array('webcomic/infinite-end.php'), true)) {
                 require self::$dir . '-/php/integrate/infinite-end.php';
             }
         }
         exit;
     }
 }