Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #205345

    awecesar
    Participant

    Hey,
    my page is http://fourtylove.com
    I added the code from: http://prntscr.com/64d2oc
    to my wordpress site but nothing shows up.
    I added it as plain html and javascript but nothing worked? 🙁
    Any idea? Thanks a lot!

    #206030

    Nabeel A
    Moderator

    Hi there,

    Thanks for writing in! Please remove the <script></script> tags from the code and add it via Appearance > Customize > Custom > Javascript.

    Let us know how this goes!

    #206151

    awecesar
    Participant

    Thanks but,
    could you paste me the code without the <script>? If I remove the there is nothing left or do I get it wrong? 😀
    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us9.list-manage.com","uuid":"e0b4c3e5a44263a65130b4d1f","lid":"fcedb42cf4"}) })</script>

    #206733

    Rad
    Moderator

    Hi there,

    It’s looks like it’s required due to config. How about just adding it like this? Add this code at your child theme’s functions.php

    add_action('wp_footer', 'my_custom_script', 20 );
    
    function my_custom_script () { ?>
    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us9.list-manage.com","uuid":"e0b4c3e5a44263a65130b4d1f","lid":"fcedb42cf4"}) })</script>
    <?php }

    Cheers!

    #206961

    awecesar
    Participant

    I tried it and it worked BUT the close button is not working – you are stuck to the pop up forever 🙁

    #207409

    Christopher
    Moderator

    Hi there,

    Can you provide us with exact URL of page having mailchimp? I can’t find it.

    Thanks.

    #207724

    awecesar
    Participant

    hey,
    you can’t click on anything else if the popup appears so I can’t leave it on the page.
    Any suggestion how I can implement the popover only on one particular site? (I will just make a private test site and post it here then)

    #207911

    Zeshan
    Member

    Hi Awecesar,

    Thanks for writing in!

    Regretfully, we cannot suggest anything while seeing the issue first hand. Would you mind activating the popover in your website so that we can take a closer look and provide you with a tailored response?

    Thanks!

    #208577

    awecesar
    Participant

    Hey, I found the problem – I already had some code in my functions.php that I got from another X-developer. I implemented it wrong.
    Could you fuse these 2 codes to one?

    <?php
    
    // Featured Image
    
    // =============================================================================
    
    //
    
    // Output featured image in an <a> tag on index pages and a <div> for single
    
    // posts and pages.
    
    //
    
    if ( ! function_exists( 'x_featured_image' ) ) :
    
      function x_featured_image( $cropped = '' ) {
    
        $stack     = x_get_stack();
    
        $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;
    
        if ( has_post_thumbnail() ) {
    
          if ( $cropped == 'cropped' ) {
    
            if ( $fullwidth ) {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-cropped-fullwidth', NULL );
    
            } else {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-cropped', NULL );
    
            }
    
          } else {
    
            if ( $fullwidth ) {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-fullwidth', NULL );
    
            } else {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack, NULL );
    
            }
    
          }
    
          
    
    	switch ( is_singular() ) {
    
            case true:
    
              printf( '<div class="entry-thumb">%s</div>', $thumb );
    
              break;
    
            case false:
    
              if ( is_page_template( 'template-layout-portfolio.php' ) ) echo '<!--is_portfolio-->';
    
              printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
    
                esc_url( get_permalink() ),
    
                esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
    
                get_the_post_thumbnail( NULL, 'portfolio-thumb', NULL )
    
              );
    
              break;
    
          }
    
        }
    
      }
    
    endif;
    
    add_image_size( 'portfolio-thumb', 380, 222, true );
    
    add_action('wp_footer', 'cache_test', 9999 );
    
    function cache_test () {
    
    echo '<!--NO-CACHE-->';
    
    }
    add_action('wp_footer', 'my_custom_script', 20 );
    
    function my_custom_script () { ?>
    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us9.list-manage.com","uuid":"e0b4c3e5a44263a65130b4d1f","lid":"fcedb42cf4"}) })</script>
    <?php }

    Thanks a lot!

    #208972

    Rue Nel
    Moderator

    Hey There,

    Just added the my_custom_script function at the bottom of the functions.php file

    
    <?php
    
    // Featured Image
    
    // =============================================================================
    
    //
    
    // Output featured image in an <a> tag on index pages and a <div> for single
    
    // posts and pages.
    
    //
    
    if ( ! function_exists( 'x_featured_image' ) ) :
    
      function x_featured_image( $cropped = '' ) {
    
        $stack     = x_get_stack();
    
        $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;
    
        if ( has_post_thumbnail() ) {
    
          if ( $cropped == 'cropped' ) {
    
            if ( $fullwidth ) {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-cropped-fullwidth', NULL );
    
            } else {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-cropped', NULL );
    
            }
    
          } else {
    
            if ( $fullwidth ) {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack . '-fullwidth', NULL );
    
            } else {
    
              $thumb = get_the_post_thumbnail( NULL, 'entry-' . $stack, NULL );
    
            }
    
          }
    
          
    
    	switch ( is_singular() ) {
    
            case true:
    
              printf( '<div class="entry-thumb">%s</div>', $thumb );
    
              break;
    
            case false:
    
              if ( is_page_template( 'template-layout-portfolio.php' ) ) echo '<!--is_portfolio-->';
    
              printf( '<a href="%1$s" class="entry-thumb" title="%2$s">%3$s</a>',
    
                esc_url( get_permalink() ),
    
                esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ),
    
                get_the_post_thumbnail( NULL, 'portfolio-thumb', NULL )
    
              );
    
              break;
    
          }
    
        }
    
      }
    
    endif;
    
    add_image_size( 'portfolio-thumb', 380, 222, true );
    
    add_action('wp_footer', 'cache_test', 9999 );
    
    function cache_test () {
    
    echo '<!--NO-CACHE-->';
    
    }
    
    add_action('wp_footer', 'my_custom_script', 20 );
    function my_custom_script () { ?>
    <script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us9.list-manage.com","uuid":"e0b4c3e5a44263a65130b4d1f","lid":"fcedb42cf4"}) })</script>
    <?php }
    
    
    #214361

    awecesar
    Participant

    Thanks! Works very well!

    Just two more questions (again ;D):

    #1 Can I exclude the script from specific sites?

    #2 Can I delay the pop up?

    Thanks!!

    #214618

    Christian
    Moderator

    Hey there,

    Those are technically possible however, it would require additional development which falls beyond the scope of our support. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://theme.co/x/member/custom-development/.

    Thank you for understanding.

    #829247

    WOA
    Participant

    Thank you for this!

    Just adding that the delay is set by Mailchimp when you create the pop up 🙂

    #829807

    Paul R
    Moderator

    You’re welcome! 🙂