Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Archive for Custom Post Types Reply To: Archive for Custom Post Types

#17643
Jon
Participant

Ok I’m feeling pretty dense. I feel like I’ve followed the instructions from the post you linked above, but I’m not having any luck getting the posts to display on the front end of the site. Maybe I’ve got the syntax wrong. I’ve got the following code in a my child theme’s category-projects.php file with the understanding it should allow the archive of my categories to be displayed by WPSP at the following link https://matchlessweb.com/category-projects

<?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( 1746 ); ?>  }
			/**
			 * 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();

Does that look right? or is there an error in here I’m missing?

The function from the WPSP page is: <?php if ( function_exists( ‘wpsp_display’ ) ) wpsp_display( 1746 ); ?>

And the shortcode is: [wp_show_posts id=”1746″]