Created
June 13, 2013 02:35
-
-
Save mbeall/5770844 to your computer and use it in GitHub Desktop.
Templates for sparks_cause for the beneficiary and project types. Use to extend Flint with the plugin Steel activated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Sparks | |
* @sub-package Causes | |
*/ | |
?> | |
<?php if ( is_user_logged_in() ) { ?> | |
<div class="container-fluid"> | |
<div class="row-fluid"> | |
<a class="btn btn-info btn-small" href="<?php echo get_edit_post_link(); ?>" style="color:#fff;float:right;"><i class="icon-edit icon-white"></i> Edit</a> | |
</div> | |
</div> | |
<?php } ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class('container-fluid'); ?>> | |
<div class="row-fluid"> | |
<div class="span4"> | |
<?php the_post_thumbnail('large'); ?> | |
</div><!-- .span4 --> | |
<div class="span8"> | |
<header class="entry-header"> | |
<h1 class="entry-title"> | |
<?php if (is_archive()) { ?> | |
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'flint' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a> | |
<?php } else { | |
the_title(); | |
}?></h1> | |
<div class="entry-meta"> | |
<?php cause_gender('<div class="cause-gender"><i class="icon-user"></i> ','</div>'); ?> | |
<?php cause_age('<div class="cause-age"><i class="icon-time"></i> ','</div>'); ?> | |
</div><!-- .entry-meta --> | |
</header><!-- .entry-header --> | |
<div class="entry-content"> | |
<?php the_content(); ?> | |
<a class="btn btn-danger" href="#" style="color:#fff;float:right;">Sponsor</a> | |
<?php flint_link_pages( array( 'before' => '<div class="pagination"><ul>', 'after' => '</ul></div>' ) ); ?> | |
</div><!-- .entry-content --> | |
<footer class="entry-meta"> | |
</footer><!-- .entry-meta --> | |
</div><!-- .span8 --> | |
</div><!-- .row-fluid --> | |
</article><!-- #post-<?php the_ID(); ?> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Sparks | |
* @sub-package Causes | |
*/ | |
?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> | |
<h1 class="entry-title"> | |
<?php if (is_archive()) { ?> | |
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'flint' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a> | |
<?php } else { | |
the_title(); | |
}?></h1> | |
<div class="entry-meta"> | |
<?php cause_goal(); ?> | |
<div class="progress progress-striped active"> | |
<?php $percent = cause_raised( array( 'before' => '', 'after' => '' ) , 'percent'); | |
echo '<div class="bar" style="width: ' . $percent . ';"></div>'; | |
?> | |
</div><!-- .entry-meta --> | |
</header><!-- .entry-header --> | |
<div class="entry-content"> | |
<?php the_content(); ?> | |
<<?php flint_link_pages( array( 'before' => '<div class="pagination"><ul>', 'after' => '</ul></div>' ) ); ?> | |
</div><!-- .entry-content --> | |
<footer class="entry-meta"> | |
<?php | |
/* translators: used between list items, there is a space after the comma */ | |
$category_list = get_the_category_list( __( ', ', 'flint' ) ); | |
/* translators: used between list items, there is a space after the comma */ | |
$tag_list = get_the_tag_list( '', __( ', ', 'flint' ) ); | |
if ( ! flint_categorized_blog() ) { | |
// This blog only has 1 category so we just need to worry about tags in the meta text | |
if ( '' != $tag_list ) { | |
$meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'flint' ); | |
} else { | |
$meta_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'flint' ); | |
} | |
} else { | |
// But this blog has loads of categories so we should probably display them here | |
if ( '' != $tag_list ) { | |
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'flint' ); | |
} else { | |
$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'flint' ); | |
} | |
} // end check for categories on this blog | |
printf( | |
$meta_text, | |
$category_list, | |
$tag_list, | |
get_permalink(), | |
the_title_attribute( 'echo=0' ) | |
); | |
?> | |
<?php edit_post_link( __( 'Edit', 'flint' ), '<span class="edit-link">', '</span>' ); ?> | |
</footer><!-- .entry-meta --> | |
</article><!-- #post-<?php the_ID(); ?> --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Template for displaying all single posts. | |
* | |
* @package Sparks | |
* @sub-package Causes | |
*/ | |
get_header(); ?> | |
<div id="primary" class="content-area span9"> | |
<div id="content" class="site-content" role="main"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php if (has_term('Projects', 'sp_cause_type')) { | |
get_template_part( 'content', 'project' ); | |
} | |
if (has_term('Beneficiaries', 'sp_cause_type')) { | |
get_template_part( 'content', 'beneficiary' ); | |
}?> | |
<?php | |
// If comments are open or we have at least one comment, load up the comment template | |
if ( comments_open() || '0' != get_comments_number() ) | |
comments_template( '', true ); | |
?> | |
<?php endwhile; // end of the loop. ?> | |
</div><!-- #content .site-content --> | |
</div><!-- #primary .content-area --> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying Archive pages. | |
* | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
* | |
* @package Sparks | |
* @sub-package Causes | |
*/ | |
get_header(); ?> | |
<section id="primary" class="content-area span9"> | |
<div id="content" class="site-content" role="main"> | |
<?php global $query_string; | |
query_posts( $query_string . '&orderby=rand&posts_per_page=100' ); | |
if ( have_posts() ) : ?> | |
<header class="page-header"> | |
<h1 class="page-title">Beneficiaries</h1> | |
</header><!-- .page-header --> | |
<?php /* Start the Loop */ ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php | |
/* Include the Post-Format-specific template for the content. | |
* If you want to overload this in a child theme then include a file | |
* called content-___.php (where ___ is the Post Format name) and that will be used instead. | |
*/ | |
get_template_part( 'content', 'beneficiary' ); | |
?> | |
<?php endwhile; ?> | |
<?php flint_content_nav( 'nav-below' ); ?> | |
<?php else : ?> | |
<?php get_template_part( 'no-results', 'archive' ); ?> | |
<?php endif; ?> | |
</div><!-- #content .site-content --> | |
</section><!-- #primary .content-area --> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The template for displaying Archive pages. | |
* | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
* | |
* @package Sparks | |
* @sub-package Causes | |
*/ | |
get_header(); ?> | |
<section id="primary" class="content-area span9"> | |
<div id="content" class="site-content" role="main"> | |
<?php if ( have_posts() ) : ?> | |
<header class="page-header"> | |
<h1 class="page-title">Projects</h1> | |
</header><!-- .page-header --> | |
<?php /* Start the Loop */ ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php | |
/* Include the Post-Format-specific template for the content. | |
* If you want to overload this in a child theme then include a file | |
* called content-___.php (where ___ is the Post Format name) and that will be used instead. | |
*/ | |
get_template_part( 'content', 'project' ); | |
?> | |
<?php endwhile; ?> | |
<?php flint_content_nav( 'nav-below' ); ?> | |
<?php else : ?> | |
<?php get_template_part( 'no-results', 'archive' ); ?> | |
<?php endif; ?> | |
</div><!-- #content .site-content --> | |
</section><!-- #primary .content-area --> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment