[Resolved] Archive Template Color of Page

Home Forums Support [Resolved] Archive Template Color of Page

Home Forums Support Archive Template Color of Page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #483701
    Todd

    Hi

    My question is how to create an archive page template and have it show up properly with the correct background color. Right now when I use the code I came up with the background behind the archives is the wrong color for pages or posts and is instead the color for the site background (body when it should be content). My custom archive template page code right now is below. Thanks for any help you can provide.

    <?php
    
    /*
    
    Template Name: Templ Archives
    
    */
    
    get_header(); ?>
    
    	<div id="primary" <?php generate_content_class();?>>
    
    		<main id="main" <?php generate_main_class(); ?>>
    
    			<?php do_action('generate_before_main_content'); ?>
    
    			<?php do_action('generate_before_content'); ?>
    
    			<?php do_action( 'generate_before_entry_title' );
    
    			the_title( sprintf( '<h2 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
    
    			do_action('generate_after_entry_title'); ?>
    
    			<?php do_action('generate_after_entry_header'); ?>
    
    				<h2>Monthly Archives</h2>
    
    				<ul>
    
    					<?php wp_get_archives( 'type=monthly&show_post_count=1' ); ?>
    
    				</ul>
    
    		<?php do_action('generate_after_entry_content'); ?>
    
    		<?php do_action('generate_after_content'); ?>
    
    			<?php do_action('generate_after_main_content'); ?>
    
    		</main><!-- #main -->
    
    	</div><!-- #primary -->
    
    	<?php
    	/**
    	 * generate_after_primary_content_area hook.
    	 *
    	 * @since 2.0
    	 */
    	 do_action( 'generate_after_primary_content_area' );
    
    	 generate_construct_sidebars();
    
    get_footer();
    GeneratePress 2.0.2
    GP Premium 1.5.6
    #483966
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    After this:

    <main id="main" <?php generate_main_class(); ?>>

    Add this:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'CreativeWork' ); ?>>
        <div class="inside-article">

    Then before this:

    </main><!-- #main -->

    Add this:

        </div><!-- .inside-article -->
    </article><!-- #post-## -->
    #484043
    Todd

    Hi,

    Okay that worked. Thanks Tom for the quick solution and response.

    #484145
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.