Title: Inserting Dynamic URLS
Last modified: July 19, 2018

---

# Inserting Dynamic URLS

 *  Resolved [swishaw](https://wordpress.org/support/users/swishaw/)
 * (@swishaw)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/inserting-dynamic-urls/)
 * Hi,
 * I’m trying to insert the Woocommerce search results into blog posts and the urls
   are like this:
 * [http://domain.com/?s=teapot&post_type=product&type_aws=true](http://domain.com/?s=teapot&post_type=product&type_aws=true)
 * So is it possible to insert such a page? I’ve tried a few different ways and 
   nothing is working.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * (@figureone)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-dynamic-urls/#post-10740487)
 * You can create a custom template to show your search results, and use the `querystring`
   param in the insert pages shortcode to pass the relevant details.
 * First, in your theme, create your custom search results template (this example
   is based off of the twentysixteen markup, so adjust to match your theme):
 *     ```
       <?php
       /*
       Template Name: Inserted Search Page
       */
       ?>
       <div class="wrap">
       	<div id="primary" class="content-area">
       		<main id="main" class="site-main" role="main">
       			<?php
       			$search = new WP_Query( $_GET );
       			while ( $search->have_posts() ) :
       				$search->the_post();
       				get_template_part( 'template-parts/content', 'search' );
       			endwhile;
       			?>
       		</main><!-- #main -->
       	</div><!-- #primary -->
       </div><!-- .wrap -->
       ```
   
 * Next, when you want to insert search results, use this form for your shortcode:
 * `[insert page='any-page-on-your-site' display='your-search-template.php' querystring
   ='s=teapot&post_type=product&type_aws=true']`
 * Note that the inserted page can be any valid page on your site; your custom search
   template above will ignore whatever that is and use the querystring values instead
   to populate its WP_Query.

Viewing 1 replies (of 1 total)

The topic ‘Inserting Dynamic URLS’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/insert-pages.svg)
 * [Insert Pages](https://wordpress.org/plugins/insert-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-pages/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Paul Ryan](https://wordpress.org/support/users/figureone/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/inserting-dynamic-urls/#post-10740487)
 * Status: resolved