diff options
Diffstat (limited to 'loop-templates')
| -rw-r--r-- | loop-templates/content-blank.php | 12 | ||||
| -rw-r--r-- | loop-templates/content-empty.php | 12 | ||||
| -rw-r--r-- | loop-templates/content-none.php | 47 | ||||
| -rw-r--r-- | loop-templates/content-page.php | 42 | ||||
| -rw-r--r-- | loop-templates/content-search.php | 52 | ||||
| -rw-r--r-- | loop-templates/content-single.php | 51 | ||||
| -rw-r--r-- | loop-templates/content.php | 59 |
7 files changed, 275 insertions, 0 deletions
diff --git a/loop-templates/content-blank.php b/loop-templates/content-blank.php new file mode 100644 index 0000000..01ff3af --- /dev/null +++ b/loop-templates/content-blank.php @@ -0,0 +1,12 @@ +<?php +/** + * Blank content partial template. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +the_content(); diff --git a/loop-templates/content-empty.php b/loop-templates/content-empty.php new file mode 100644 index 0000000..5681144 --- /dev/null +++ b/loop-templates/content-empty.php @@ -0,0 +1,12 @@ +<?php +/** + * Content empty partial template. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +the_content(); diff --git a/loop-templates/content-none.php b/loop-templates/content-none.php new file mode 100644 index 0000000..250152a --- /dev/null +++ b/loop-templates/content-none.php @@ -0,0 +1,47 @@ +<?php +/** + * The template part for displaying a message that posts cannot be found. + * + * Learn more: http://codex.wordpress.org/Template_Hierarchy + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<section class="no-results not-found"> + + <header class="page-header"> + + <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'understrap' ); ?></h1> + + </header><!-- .page-header --> + + <div class="page-content"> + + <?php + if ( is_home() && current_user_can( 'publish_posts' ) ) : ?> + + <p><?php printf( wp_kses( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'understrap' ), array( + 'a' => array( + 'href' => array(), + ), +) ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p> + + <?php elseif ( is_search() ) : ?> + + <p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'understrap' ); ?></p> + <?php + get_search_form(); + else : ?> + + <p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'understrap' ); ?></p> + <?php + get_search_form(); + endif; ?> + </div><!-- .page-content --> + +</section><!-- .no-results --> diff --git a/loop-templates/content-page.php b/loop-templates/content-page.php new file mode 100644 index 0000000..0de1a9c --- /dev/null +++ b/loop-templates/content-page.php @@ -0,0 +1,42 @@ +<?php +/** + * Partial template for content in page.php + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<article <?php post_class(); ?> id="post-<?php the_ID(); ?>"> + + <header class="entry-header"> + + <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> + + </header><!-- .entry-header --> + + <?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?> + + <div class="entry-content page-mt"> + + <?php the_content(); ?> + + <?php + wp_link_pages( array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), + 'after' => '</div>', + ) ); + ?> + + </div><!-- .entry-content --> + + <footer class="entry-footer"> + + <?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?> + + </footer><!-- .entry-footer --> + +</article><!-- #post-## --> diff --git a/loop-templates/content-search.php b/loop-templates/content-search.php new file mode 100644 index 0000000..be34c68 --- /dev/null +++ b/loop-templates/content-search.php @@ -0,0 +1,52 @@ +<?php +/** + * Search results partial template. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<article <?php post_class(); ?> id="post-<?php the_ID(); ?>"> + + <header class="entry-header"> + + <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), + '</a></h2>' ); ?> + + <?php if ( 'post' == get_post_type() ) : ?> + + <div class="entry-meta"> + + <?php understrap_posted_on(); ?> + + </div><!-- .entry-meta --> + + <footer class="entry-footer"> + + <div class="row"> + <?php understrap_entry_footer(); ?> + </div> + + </footer><!-- .entry-footer --> + + <?php endif; ?> + + </header><!-- .entry-header --> + + <a href="<?php echo esc_url( get_permalink() );?>"> + <?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?> + </a> + + <div class="entry-summary entry-content"> + + <?php the_excerpt(); ?> + + </div><!-- .entry-summary --> + <div class="clearfix"></div> + + +</article><!-- #post-## --> diff --git a/loop-templates/content-single.php b/loop-templates/content-single.php new file mode 100644 index 0000000..76c6bbd --- /dev/null +++ b/loop-templates/content-single.php @@ -0,0 +1,51 @@ +<?php +/** + * Single post partial template. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<article <?php post_class(array('')); ?> id="post-<?php the_ID(); ?>"> + + <header class="entry-header"> + + <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> + + <?php echo get_the_post_thumbnail( $post->ID, 'large', array( 'class' => 'mx-auto d-block border rounded' ) ); ?> + + <div class="entry-meta entry-meta-single text-muted"> + + <?php understrap_posted_on(); ?> + + </div><!-- .entry-meta --> + <footer class="entry-footer"> + + <div class="row"> + <?php understrap_entry_footer(); ?> + </div> + + </footer><!-- .entry-footer --> + + </header><!-- .entry-header --> +<hr> + + <div class="entry-content"> + + <?php the_content(); ?> + + <?php + wp_link_pages( array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), + 'after' => '</div>', + ) ); + ?> + + </div><!-- .entry-content --> + + +</article><!-- #post-## --> diff --git a/loop-templates/content.php b/loop-templates/content.php new file mode 100644 index 0000000..3205ad9 --- /dev/null +++ b/loop-templates/content.php @@ -0,0 +1,59 @@ +<?php +/** + * Post rendering content according to caller of get_template_part. + * + * @package understrap + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} +?> + +<article <?php post_class('article-mb'); ?> id="post-<?php the_ID(); ?>"> + + <header class="entry-header"> + + <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), + '</a></h2>' ); ?> + + <?php if ( 'post' == get_post_type() ) : ?> + + <div class="entry-meta"> + <?php understrap_posted_on(); ?> + </div><!-- .entry-meta --> + + <footer class="entry-footer"> + + <div class="row"> + <?php understrap_entry_footer(); ?> + </div> + + </footer><!-- .entry-footer --> + + <?php endif; ?> + + </header><!-- .entry-header --> + + <a href="<?php echo esc_url( get_permalink() );?>"> + <?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?> + </a> + + <div class="entry-content"> + + <?php + the_excerpt(); + ?> + + <?php + wp_link_pages( array( + 'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ), + 'after' => '</div>', + ) ); + ?> + + </div><!-- .entry-content --> + <div class="clearfix"></div> + + +</article><!-- #post-## --> |
