0

Calling code into the footer - wordpress

Hi, I've used markup to call in a shortcode for a mailchimp sign-up form in the footer of my Wordpress site. Thing is its not working but I'm not sure why as I've used the code as perscribed. It works when I put it in as a shortcode in a page or post - just not in the footer. Any thoughts?

Thanks!

<footer id="main-footer">
<?php get_sidebar( 'footer' ); ?>
<?php get_header('header'); ?>
<?php $template_directory_uri = get_template_directory_uri(); ?>
<div id="footer-bottom">
    <div class="container">
    <div id="signup">



<?php echo do_shortcode('[mcsignup]'); // MailChimp Sign Up Form  ?>




    </div> <!-- end .#signup -->
    <div id="social-icons">
        <?php
            $et_rss_url = '' != et_get_option( 'harmony_rss_url' ) ? et_get_option( 'harmony_rss_url' ) : get_bloginfo( 'comments_rss2_url' );
            if ( 'on' == et_get_option( 'harmony_show_twitter_icon', 'on' ) ) $social_icons['twitter'] = array( 'image' => $template_directory_uri . '/images/twitter.png', 'url' => et_get_option( 'harmony_twitter_url' ), 'alt' => __( 'Twitter', 'Harmony' ) );
            if ( 'on' == et_get_option( 'harmony_show_rss_icon', 'on' ) ) $social_icons['rss'] = array( 'image' => $template_directory_uri . '/images/rss.png', 'url' => $et_rss_url, 'alt' => __( 'Rss', 'Harmony' ) );
            if ( 'on' == et_get_option( 'harmony_show_facebook_icon','on' ) ) $social_icons['facebook'] = array( 'image' => $template_directory_uri . '/images/facebook.png', 'url' => et_get_option( 'harmony_facebook_url' ), 'alt' => __( 'Facebook', 'Harmony' ) );
            if ( 'on' == et_get_option( 'harmony_show_soundcloud_icon', 'on' ) ) $social_icons['soundcloud'] = array( 'image' => $template_directory_uri . '/images/soundcloud.png', 'url' => et_get_option( 'harmony_soundcloud_url' ), 'alt' => __( 'SoundCloud', 'Harmony' ) );

            if ( ! empty( $social_icons ) ) {
                $social_icons = apply_filters( 'et_social_icons', $social_icons );
                foreach ( $social_icons as $icon ) {
                    if ( $icon['url'] )
                        printf( '<a href="%s" target="_blank"><img src="%s" alt="%s" /></a>', esc_url( $icon['url'] ), esc_attr( $icon['image'] ), esc_attr( $icon['alt'] ) );
                }
            }
        ?>
        </div> <!-- end .#social-icons -->

      <p id="copyright"><a href="http://www.knifeworld.co.uk/"> &#169; 2014 Knifeworld</a></p>
    </div> <!-- end .container -->
</div> <!-- end #footer-bottom -->

Brett Holmes
  • 397
  • 5
  • 20
Project-404
  • 305
  • 2
  • 13

2 Answers2

1

Answering my own question but after some digging I found that the call to the /wp-admin/admin-ajax.php was incorectly formatted and the file could not be loaded. After makeing the link absolute it worked just fine.

Project-404
  • 305
  • 2
  • 13
0

You might check make sure the plugin was installed correctly and the API settings match up with your MailChimp account. If your API settings are correct, you can try deleting the plugin and reinstalling it either in the WP dashboard or through SSH or FTP in the /wp-content/plugins directory.

  • As I say its works just fine when its installed elsewhere.. Its only when its used in the footer it stops working. – Project-404 Jul 29 '14 at 08:31