We're merging with GenerateBlocks! Learn more here.

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

#9823
Dee
Participant

I thought this was working correctly as I had my blog redirected to a page, but for my generic “blog” archive, I am not getting the correct WPshowposts. I belive it is the “else” below, but I am not sure how to fix this.
Here is what I have in the content section of the archive.php file”

			if ( have_posts() ) :

				/**
				 * generate_archive_title hook.
				 *
				 * @since 0.1
				 *
				 * @hooked generate_archive_title - 10
				 */
				do_action( 'generate_archive_title' );

						$cat = get_queried_object();
						$cat_slug = $cat->slug;
						$cat_tax = $cat->taxonomy;

							if ($cat_tax=='category'):  $list = get_page_by_title( 'Simple', 'OBJECT', 'wp_show_posts' );

							elseif ($cat_tax=='event_category'): $list = get_page_by_title( 'Simple-Event', 'OBJECT', 'wp_show_posts' );

							elseif ($cat_tax=='source'): $list = get_page_by_title( 'Simple-Client', 'OBJECT', 'wp_show_posts' );
							
							endif;
	
						wpsp_display( $list->ID, 'tax_term="' . $cat_slug . '"' );
	
				generate_content_nav( 'nav-below' );

			else :

				get_template_part( 'no-results', 'archive' );

			endif;

I am getting the generic post format instead of the wpsp_display format.
I have a page named “Blog”, and my Homepage settings are set to “Posts”.
Blog displays like I want, but when I switch my home page settings to “Blog” instead of “Posts” it reverts to the generic layout.
I have the archive.php saved in the GP-child theme.