Hi Ben,
I did everthing you and Robbie explained and it looks good, except for one thing:
The text now appears as background in the new posts page and is aligned to the left. How can I have the text on the new posts page in a text editor (so I can align it and change the format) instead of as background? I am a beginner and I guess it has to do with the NEW single.php file and the new content file. I attach both files and would be really greatful for a feedback.
Here is the new single.php file (code content from the original full-width-page.php) and the page I insert there is called “beitragsseite”:
<?php
/**
- Template Name: Full Width Page
-
@package Tesseract
*/
get_header();
?>
<div id="primary" class="full-width-page no-sidebar">
<main id="main" class="site-main" role="main">
<?php echo do_shortcode( "[insert page='beitragsseite' display='content']" ); ?>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override 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-beitragsseite', 'single' );
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'content-beitragsseite', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php $layout_default = get_theme_mod( ‘tesseract_woocommerce_default_layout’ ); ?>
<?php if ( ( is_plugin_active(‘woocommerce/woocommerce.php’) && ( ( $layout_default == ‘sidebar-left’ ) || ( $layout_default == ‘sidebar-right’ ) ) ) ) get_sidebar(); ?>
<?php get_footer(); ?>
Now here is the NEW content file which I named content-beitragsseite.php:
<?php
/**
- The template used for displaying page content in page.php
-
@package Tesseract
*/
?>
<article id=“post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) {
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesseract-large' ); ?>
<div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)">
<?php if ( my_theme_show_page_header() ) : ?>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<?php endif; ?>
</div><!-- .entry-background -->
<?php } else { ?>
<?php if ( my_theme_show_page_header() ) : ?>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<?php endif; ?>
<?php } ?>
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'tesseract' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
Thank you.