remove code duplication

This commit is contained in:
IanDelMar 2022-03-18 18:44:30 +01:00
parent 9d492d93c6
commit ce67be94e1
3 changed files with 11 additions and 78 deletions

View File

@ -1,31 +0,0 @@
<?php
/**
* Partial template for content in page.php
*
* @package Understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content">
<?php
the_content();
understrap_link_pages();
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php understrap_edit_post_link(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

View File

@ -11,13 +11,16 @@ defined( 'ABSPATH' ) || exit;
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header">
<?php
if ( ! is_page_template( 'page-templates/no-title.php' ) ) {
the_title(
'<header class="entry-header"><h1 class="entry-title">',
'</h1></header><!-- .entry-header -->'
);
}
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
echo get_the_post_thumbnail( $post->ID, 'large' );
?>
<div class="entry-content">

View File

@ -2,7 +2,7 @@
/**
* Template Name: No Title, Full Width Page
*
* This template can be used to override the default template and sidebar setup
* This template can be used to override the default template
*
* @package Understrap
*/
@ -10,43 +10,4 @@
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();
$container = get_theme_mod( 'understrap_container_type' );
?>
<div class="wrapper py-0" id="no-title-page-wrapper">
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
<div class="row">
<div class="col-md-12 content-area" id="primary">
<main class="site-main" id="main">
<?php
while ( have_posts() ) {
the_post();
get_template_part( 'loop-templates/content', 'notitle' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
}
?>
</main><!-- #main -->
</div>
</div><!-- .row -->
</div><!-- #content -->
</div><!-- #page-wrapper -->
<?php
get_footer();
get_template_part( 'page-templates/fullwidthpage' );