[Support request] how to install a pop up using a javascript code?

Home Forums Support [Support request] how to install a pop up using a javascript code?

Home Forums Support how to install a pop up using a javascript code?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1567884
    Kimberleigh

    I’m using GP version 3.0.2 and version of GP Premium: 1.12.2 and I cannot seem to be able to add a pop up javascript to the header menu which is doable with any other theme. I bought the theme as I was hoping that it would be useable… Please help.

    I look forward to your assistance,

    Kimberleigh.

    #1567974
    Leo
    Staff
    Customer Support

    Hi there,

    What exactly are you trying to add and where are you trying add it?

    Do you have any instruction on how the code should be added?

    The theme itself doesn’t load jQuery by default so make sure you load it first before it will work:
    https://generatepress.com/forums/topic/latest-update-doesnt-work-with-wp-quiz/#post-1479625

    #1568645
    Kimberleigh

    Hi Leo,

    I am trying to add a pop up code: <script type=”text/javascript” src=”http://www.superleadfunnels.com/fb/index.asp?f=25769″></script&gt;
    which I added to the header menu of the editor and it doesn’t work, which is strange as it works on WP 2016 theme. I have also tried putting this code to the header element as a hook and it still doesn’t work. I looks like I wasted my money getting a premium version of the theme if it will not work to put up a simple string of code for a pop up… What else is possible…?

    Thanks for your support

    Kimberleigh

    #1568654
    Leo
    Staff
    Customer Support

    which I added to the header menu of the editor and it doesn’t work, which is strange as it works on WP 2016 theme.

    Sorry what are you referring to with the header menu of the editor?

    Can you show a screenshot?
    https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots

    Where did you get the code from? Is there an instruction on how it is supposed to be added?

    #1568881
    Kimberleigh

    Leo, I created the code and as I have mentioned it works perfectly well on every other theme except this awful GP theme. I cannot upload pictures on here as of course unlike any other platform, this has to be so complicated… This is really annoying because when you pay for the theme you are promised customer support but then it only means back and for ridiculous questions. The header menu is as you should already know something like this:

    <?php
    /**
     * The template for displaying the header.
     *
     * @package GeneratePress
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<link rel="profile" href="https://gmpg.org/xfn/11">
    	<?php wp_head(); ?> 
    </head>
    
    <body <?php body_class(); ?> <?php generate_do_microdata( 'body' ); ?>>
    	<?php
    	/**
    	 * wp_body_open hook.
    	 *
    	 * @since 2.3
    	 */
    	do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core WP hook.
    
    	/**
    	 * generate_before_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_do_skip_to_content_link - 2
    	 * @hooked generate_top_bar - 5
    	 * @hooked generate_add_navigation_before_header - 5
    	 */
    	do_action( 'generate_before_header' );
    
    	/**
    	 * generate_header hook.
    	 *
    	 * @since 1.3.42
    	 *
    	 * @hooked generate_construct_header - 10
    	 */
    	do_action( 'generate_header' );
    
    	/**
    	 * generate_after_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_featured_page_header - 10
    	 */
    	do_action( 'generate_after_header' );
    	?>
    
    	<div>>
    		<?php
    		/**
    		 * generate_inside_site_container hook.
    		 *
    		 * @since 2.4
    		 */
    		do_action( 'generate_inside_site_container' );
    		?>
    		<div class="site-content">
    			<?php
    			/**
    			 * generate_inside_container hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_inside_container' );
    
    <strong>Which when it contains the code snippet looks like this:</strong>
    
    <?php
    /**
     * The template for displaying the header.
     *
     * @package GeneratePress
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<link rel="profile" href="https://gmpg.org/xfn/11">
    	<?php wp_head(); ?> 
    <script type="text/javascript" src="http://www.superleadfunnels.com/fb/index.asp?f=25769"></script>
    </head>
    
    <body <?php body_class(); ?> <?php generate_do_microdata( 'body' ); ?>>
    	<?php
    	/**
    	 * wp_body_open hook.
    	 *
    	 * @since 2.3
    	 */
    	do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core WP hook.
    
    	/**
    	 * generate_before_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_do_skip_to_content_link - 2
    	 * @hooked generate_top_bar - 5
    	 * @hooked generate_add_navigation_before_header - 5
    	 */
    	do_action( 'generate_before_header' );
    
    	/**
    	 * generate_header hook.
    	 *
    	 * @since 1.3.42
    	 *
    	 * @hooked generate_construct_header - 10
    	 */
    	do_action( 'generate_header' );
    
    	/**
    	 * generate_after_header hook.
    	 *
    	 * @since 0.1
    	 *
    	 * @hooked generate_featured_page_header - 10
    	 */
    	do_action( 'generate_after_header' );
    	?>
    
    	<div>>
    		<?php
    		/**
    		 * generate_inside_site_container hook.
    		 *
    		 * @since 2.4
    		 */
    		do_action( 'generate_inside_site_container' );
    		?>
    		<div class="site-content">
    			<?php
    			/**
    			 * generate_inside_container hook.
    			 *
    			 * @since 0.1
    			 */
    			do_action( 'generate_inside_container' );
    #1568939
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    We’re doing our best to help – we’ll get it sorted, but it may take some questions to figure it out.

    Can you link us to the site where you’ve added the code? Adding something to the <head> like you’ve done should work regardless of the theme (or even WP) – it should work on a regular HTML page if it’s set up correctly.

    Instead of adding it to the file like that, I suggest using a function like this:

    add_action( 'wp_head', function() {
        ?>
        <script type="text/javascript" src="http://www.superleadfunnels.com/fb/index.asp?f=25769"></script>
        <?php
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    This way you’re not editing core files or overwriting parent files unnecessarily.

    When is the popup supposed to intitiate? When you first load the site? When something is clicked?

    Let me know 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.