Site logo

Archived topic

add generatepress columns/grid to child template file

9 replies · Started by Tim on January 12, 2023

Viewing posts 1–10 of 10

Hi. I have a child theme, on which I have embedded a wp form. That works fine, but it's 100% wide, so I wanted to add columns or a grid to the theme file. Following is a pseudo-code representation of what I'm trying to do. I don't know what the html would be to leverage the GP grid:

 
<?php echo do_shortcode("[wpforms id='200']"); ?>
 

oh, your forum dropped my html. let me try again, using the codeblock:

<div class="twentyfivepercent">&nbsp;</div>
<div class="fiftypercent"><?php echo do_shortcode(“[wpforms id=’200′]”); ?></div>
<div class="twentyfivepercent">&nbsp;</div>

Hi there,

If you get stuck , share a link to where we can see it on your site and we will take a look

Thanks, David. I was doing some other stuff for a bit there, but I still have the issue. I'd like to make the form less wide, using code in a php template file. Below is a link to a page where the wide form is displayed and below that, is the page template code as-is.

http://perischwartz.timthorp.com/artwork/bottles-jars-xxxvi-2014-22x36/

	<div <?php generate_do_attr( 'content' ); ?>>
		<main <?php generate_do_attr( 'main' ); ?>>
			<div class="artwork">
				<?php
				/**
				 * generate_before_main_content hook.
				 *
				 * @since 0.1
				 */
				do_action( 'generate_before_main_content' ); 
			
				if ( generate_has_default_loop() ) {
					while ( have_posts() ) :

						the_post();

						generate_do_template_part( 'single' );

					endwhile;
				}
				if (get_field('location') == 'NAGA'){
					//naga form
					echo "<h2>Inquire with the Schwartz Estate (text TBD)</h2>";
					echo do_shortcode("[wpforms id='886']");
				}else{
					//general for sale form
					echo "<h2>Inquire with Gallery NAGA (text TBD)</h2>";
					echo do_shortcode("[wpforms id='200']");
				}
			
				/**
				 * generate_after_main_content hook.
				 *
				 * @since 0.1
				 */
				do_action( 'generate_after_main_content' );
				?>
			</div>
		</main>
	</div>

Can you confirm that URL ? as it is 404ing for me

Thanks. This is kinda odd, but for some reason the link works, except that somewhere, the "x" in the url is transformed into a shorter x. I'll paste the link as code to see if it helps.

http://perischwartz.timthorp.com/artwork/bottles-jars-xxxvi-2014-22x36/

How odd is that lol - i got there :)

I would use some CSS like this:

.artwork .wpforms-container {
    max-width: 600px;
}

wow. that was easy! I gotta learn flex so that this makes more sense. Thanks, David!

You're welcome

This archived topic is closed to new replies.