Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Use WP Show Posts to Replace Blog Archive Page Reply To: Use WP Show Posts to Replace Blog Archive Page

#18042
Jon
Participant

I followed the tutorial you referenced, Tom.

I replaced the default loop of the parent archive template (archive.php) with my WPSP function and that code looks like this:

<?php
/**
 * The template for displaying Archive pages.
 *
 * @package GeneratePress
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

get_header(); ?>

	<div id="primary" <?php generate_do_element_classes( 'content' ); ?>>
		<main id="main" <?php generate_do_element_classes( 'main' ); ?>>
			<?php
			/**
			 * generate_before_main_content hook.
			 *
			 * @since 0.1
			 */
			do_action( 'generate_before_main_content' );

			<?php if ( function_exists( 'wpsp_display' ) ) wpsp_display( 1736 ); ?>

			/**
			 * generate_after_main_content hook.
			 *
			 * @since 0.1
			 */
			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();

Now my question is: Do I need to name the file something different than “archive.php” if I want to put it in my child theme and have it replace the standard blog archive page template?

  • This reply was modified 11 months, 4 weeks ago by Jon.
  • This reply was modified 11 months, 4 weeks ago by Jon.