-
AuthorPosts
-
November 5, 2019 at 1:06 am #1153802
There are a few pages on my site that I need to create but that cannot use the page builder. For example, I am trying to edit the “activate user” page that appears when a user of my website is registering. I’m following the directions at https://gravitywiz.com/customizing-gravity-forms-user-registration-activation-page/ (since I’m using Gravity Forms for this). All is working OK except that the activation page I’ve created does not properly pick up the header from my site. How do I get these pages to work with the theme without using the page builder?
November 5, 2019 at 1:19 am #1153803Hey dannikb,
Can you provide a link to the site/page in question so we can look into this issue further. Currently, how are you adding the form? Via shortcode?
Best regards,
Jordan ShannonNovember 5, 2019 at 3:58 am #1153865Right now I’m testing this on a staging site, so you can look at it there. I’ll provide credentials. Feel free to use the form to register/test/etc.
How it works is this:
Visitors go to the /register page, and complete the multi-step form. This is implemented using Gravity Forms, with the form shortcode on this page. I am using the Pro version of Gravity Forms and the User Registration add-on, so after the user submits the form, they are emailed a link to activate their account. When the click the link, they are taken to a page using active.php (in my child theme, per the directions at https://gravitywiz.com/customizing-gravity-forms-user-registration-activation-page/). This is the page that I’m attempting to format. I’ll also need to format the error and success versions of that page as well.The active.php code is:
<?php global $gw_activate_template; define( 'WP_INSTALLING', true ); $gw_activate_template = new GWActivateTemplate(); $gw_activate_template->template(); class GWActivateTemplate { function __construct( $args = array() ) { extract( wp_parse_args( $args, array( 'template_folder' => basename( dirname( __file__ ) ) ) ) ); $this->template_folder = $template_folder; $this->load_gfur_signup_functionality(); $this->hooks(); } function load_gfur_signup_functionality() { if( function_exists( 'gf_user_registration' ) ) { $signups = gf_user_registration()->get_base_path() . '/includes/signups.php'; } else { $signups = GFUser::get_base_path() . '/includes/signups.php'; } // include GF User Registration functionality require_once( $signups ); GFUserSignups::prep_signups_functionality(); } function hooks() { add_action('body_class', create_function('$classes', '$classes[] = "gfur-activate"; return $classes;')); } function do_activate_header() { do_action( 'activate_wp_head' ); } function wpmu_activate_stylesheet() { ?> <style type="text/css"> form { margin-top: 2em; } #submit, #key { width: 90%; font-size: 24px; } #language { margin-top: .5em; } .error { background: #f66; } span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; } </style> <?php } function has_activation_key() { return !empty($_GET['key']) || !empty($_POST['key']); } function get_activation_key() { if( isset( $_GET['key'] ) && $_GET['key'] ) return $_GET['key']; if( isset( $_POST['key'] ) && $_POST['key'] ) return $_POST['key']; return false; } function is_blog_taken( $result ) { return 'blog_taken' == $result->get_error_code(); } function is_blog_already_active( $result ) { return 'already_active' == $result->get_error_code(); } function template() { do_action( 'activate_header' ); add_action( 'wp_head', array( $this, 'do_activate_header' ) ); add_action( 'wp_head', array( $this, 'wpmu_activate_stylesheet' ) ); get_header(); ?> <div id="content" class="widecolumn"> <?php if ( !$this->has_activation_key() ) { get_template_part( $this->template_folder . '/activate', 'no-key' ); } else { $key = $this->get_activation_key(); $this->result = GFUserSignups::activate_signup($key); if ( is_wp_error( $this->result ) ) { get_template_part( $this->template_folder . '/activate', 'error' ); } else { get_template_part( $this->template_folder . '/activate', 'success' ); } } ?> </div> <script type="text/javascript"> var key_input = document.getElementById('key'); key_input && key_input.focus(); </script> <?php get_footer(); } } ?>
Right now, the activate page doesn’t display the theme header properly. It seems to be transparent and/or just not appearing at all, with the body of the page overlapping it.
November 7, 2019 at 9:10 pm #1154739Hi,
Any update on this?Thanks!
November 10, 2019 at 5:36 pm #1155352Hi,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.