Skip Navigation

[Resolved] Content Templates not showing with Impreza theme using custom single.php

This thread is resolved. Here is a description of the problem and solution.

Problem:
Content Templates not showing with Impreza theme when using custom single.php template file, along with WP Store Locator plugin to create better individual store pages.

Solution:
Solution here:
https://toolset.com/forums/topic/content-templates-not-showing-with-impreza-theme-using-custom-single-php/#post-570481

Relevant Documentation:
https://wpstorelocator.co/document/create-custom-store-page-template/

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Nick Pierno 7 years, 2 months ago.

Assisted by: Noman.

Author
Posts
#570347

Reference thread: https://toolset.com/forums/topic/content-templates-not-showing-on-front-end-with-impreza-theme/

I'm trying to use Types/Views along with WP Store Locator to create better individual store pages than WP Store Locator offers by default (and add a few custom fields to the store custom post type).

I'm trying to hijack the store post single.php (single-wpsl_stores.php), and use my theme's page.php code inside of that to get a blank slate for my content template.

The problem is, when I put that template in my child theme, the content template doesn't show up again: hidden link

If I remove or rename single-wpsl_stores.php, it comes back.

If I use debug mode, it tells me that us_load_template is the function I need (hidden link) - but that's already set in the Front-end Content settings!

Basically all I need is just an empty page that displays my content template (without the title and meta info, and ideally without WP Store Locator's default stuff - but I can just hide that with CSS if need be). Any ideas?

#570387

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Nick,

Thanks for posting this. I have some clues on this, I am checking it further and will get back to you with my findings.

Thank you

#570451

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Findings so far:

1. CPT >> Portfolio >> custom Blank, php single template applied >> then I tried applying View's CT on it, this working fine as you can see here: hidden link

2. CPT >> Store locator (of the plugin) >> custom php single template applied >> then I tried applying View's CT on it, it shows content of the CT (ignore text position its for testing). But the problem is the plugin's content is still coming through and overriding it:
hidden link

So now the challenge is not applying CT directly but its: How to hide Store locator's content from the php page template so that it gives us blank page with a "content function" and where we can apply our CT (just like a normal Portfolio cpt above).

We may need to get in contact with Store Locator author to add compatibility and have a better way of doing this. For now I am working further to see if I can get its content to be removed from the page in some way. Will update your accordingly.

Thanks

#570465

Wow, thank you very much for your efforts on this. I'm not opposed to hiding the WP Store Locator stuff with CSS.

They also provide these instructions in their documentation - but it's a bit over my head: hidden link

If nothing else though, I can get away with using what you've come up with in example 2 (and hiding the unneeded stuff with CSS). I'd just need to sort out how to get the standard paddings/margins from the theme back (those look to be missing on my end for some reason. Maybe just a missing class on the body output?)

Really do appreciate your help here Norman!

#570481

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for the doc link, I managed to get it working using that. Please check here:
hidden link

In Child theme I have added this file "single-wpsl_stores.php" >> inside this template file I added following code to have a blank template:

<?php get_header();?>

<div class="l-main">
<div class="l-main-h i-cf">
<main class="l-content" itemprop="mainContentOfPage">
	<section class="l-section">
		<div class="l-section-h i-cf">
			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
				<div class="entry-content">
					<?php
			global $post;
			$queried_object = get_queried_object();
			
			// Add the map shortcode
			//echo do_shortcode( '[wpsl_map]' );
			
			// Add the content
			$post = get_post( $queried_object->ID );
			setup_postdata( $post );
			the_content();
			wp_reset_postdata( $post );
			
			// Add the address shortcode
			//echo do_shortcode( '[wpsl_address]' );
		?>
				</div>
			</article>
		</div>
	</section>
</main>
</div>
</div>
<?php get_footer(); ?>

I hope its good now. Thank you

#570484

Welp, you are basically my hero. Thank you very much for your help with this.

Is that code a combination of the Impreza single.php and the WP Store Locator post template? (just for my understanding - if you don't have time to explain, that's totally fair).

Thanks again, and sorry for being a bit difficult about the new ticket thing. It was 5 am for me (and I'm a deadline to figure this out by yesterday 😛 )

#570486

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Is that code a combination of the Impreza single.php and the WP Store Locator post template?
-- Yes that's true, its a combination of both: HTML is from Impreza theme and PHP code is from WP Store Locator template.

#570487

Got it, thanks. I tried to hack something like that together too - but I don't know what I'm doing 😛

Much appreciated!!