title: wp_footer hook puts content below footer
body: <p>My custom plugin to put a red sign-up bar just above the footer is putting it at the bottom of the footer using wp_footer.  If I use the the_content in a filter, then it puts it into the description of the Woo Commerce product pages.  Does anyone know of a way to move this action from the bottom to the top of the footer inside of the plugin? I have tried many combinations of things and am just getting no where.  Thank you for helping.</p>
  
  <p><a href="https://i.stack.imgur.com/SIKbB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SIKbB.jpg" alt="Photo where Red Bar is on bottom and not top of footer"></a></p>
  
  <p><strong>Signup Bar Plugin</strong></p>
  
  <pre><code>&lt;?php 
  /*
  Plugin Name: ccg-signup
  Description:  Adds an eye-catching signup bar to the bottom of the page
  Author: Teresa Light
  Author URI: https://teresalight.com
  Plugin URI: 
  Version: 1.0
  License: 
  */
  
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  
  /**
   * Register style sheet.
   */
  
     add_action( 'wp_enqueue_scripts', 'register_plugin_styles' );
  
  
    function register_plugin_styles() {
      wp_register_style( 'ccg-signup', plugins_url( 'ccg-signup/css/signup-bar.css' ) );
      wp_enqueue_style( 'ccg-signup' );
      }
  
  /**
   * Add HTML markup for the bar
   */
  
      function signup_bar($content){
      ?&gt;  &lt;!-- /** Use this to end PHP for the action hook test.  Add the next line for the php variable instead.*/ --&gt;
  
              &lt;signup&gt;
                      &lt;form class="flex-container" accept-charset="UTF-8" method="POST" action="https://eu943.infusionsoft.com/app/form/process/ae41b9e4b0750e3e3aa3ae78337d5fa6"&gt;
                          &lt;input name="inf_form_xid" type="hidden" value="ae41b9e4b0750e3e3aa3ae78337d5fa6"&gt;
                          &lt;input name="inf_form_name" type="hidden" value="CCG Newsletter Sign Up"&gt;
                          &lt;input name="infusionsoft_version" type="hidden" value="1.38.0.37"&gt;
  
                          &lt;div class="flex-container"&gt;
                              &lt;h3 class="signup-message"&gt;Get tips to start, fund and grow Your Great Business:&lt;/h3&gt;
                          &lt;/div&gt; 
  
                          &lt;div class="flex-container"&gt;
                              &lt;input id="inf_field_FirstName"  name="inf_field_FirstName" type="text" placeholder="First Name*"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="flex-container"&gt;
                              &lt;input style="margin:10px 0;"id="inf_field_Email" name="inf_field_Email" type="text" placeholder="Email*"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="flex-container"&gt;
                              &lt;input class="input.flex-container ccg-button" type="submit" value="START NOW"&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
              &lt;/signup&gt;
      &lt;?php
      }
  // Omit closing PHP tag to avoid "Headers already sent" issues.
  // EXTRA CODE BELOW SHOWING PAST TRIALS, CURRENTLY COMMENTED OUT
  /* The next two lines of code when used with the HTML based function will put the bar in the right place on Woo pages only */
  /*remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 1);
  add_action('woocommerce_after_main_content', 'signup_bar', 1);
   */
  
  /* This line of code will put the signup bar correct on normal pages but in the description on the woo pages. It only works when the function code is totally inside of php */
  /*add_filter( 'the_content', 'signup_bar',1 );*/
  
  
  /*The code below works correctly on all pages but at the bottom of the footer, and not the top.*/
  add_action( 'wp_footer', 'signup_bar', 1); 
  </code></pre>
  
  <p><strong>Signup Bar CSS</strong></p>
  
  <pre><code>#main.clearfix.width-100{
      padding-right:0px!important;
      padding-left:0px!important;
  }
  
  /* Overall Container */
  signup  {
    margin: auto;
    padding: auto 0px!important;
    font-size:80%;
    background: #d03925;
    text-align: center;  
    display: flex;  /* NEW, Spec - Opera 12.1, Firefox 20+ */
    display: -webkit-flex; /* NEW - Chrome */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
  }
  /* Begin Flex */
  .flex-container {
    text-align: center;  
    display: flex;  /* NEW, Spec - Opera 12.1, Firefox 20+ */
    display: -webkit-flex; /* NEW - Chrome */
    display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
     -webkit-align-items: center;
     align-items: center;
     -webkit-justify-content: center;
     justify-content: center;
  }
  
  /* MOBIL FIRST */
  .flex-container{
     flex-direction: column;
     -webkit-box-flex-direction: column;
    -moz-box-flex-direction: column;
    -webkit-flex-direction: column;
    margin:0 0 5px 0;
    padding:15px;
  }
  
  /* DESKTOPS - go to a row for screens greater than 1000px */ 
  @media screen and (min-width: 1024px) {
    .flex-container{
     flex-direction: row;
     -webkit-box-flex-direction: row;
    -moz-box-flex-direction: row;
    -webkit-flex-direction: row;
    margin:0 10px;
    padding:10px 0;
    }
  }
  /* End  Flex */
  
  h3.signup-message, .signup-message{
    margin: auto;
    padding:0;
    color: #ffffff !important;
    font-family: 'lato', sans-serif;
    font-weight: 500; 
    text-align:center;
    font-size:20px;
    line-height:30px;
  }
  
  #inf_field_FirstName, #inf_field_Email {
    border: 1px solid #d2d2d2;
    font-size: 15px;
    font-family: 'lato', sans-serif;
    color: #747474;
    padding: 15px 5px;
    width: 270px;
  }
  
  .ccg-button {
      border-width: 2px;
      border-style: solid;
      border-color:#ffffff;
      background: #d03925;
      color: #fff;
      font-family: 'lato', sans-serif;
      font-weight: 700;
      line-height: 20px;
      font-size:15px;
      cursor: pointer;
      padding: 13px 30px 13px 30px;
  }
  .ccg-button:hover, .ccg-button:focus, .ccg-button:active{
      border-width:2px;
      border-style: solid;
      border-color:#d03925;
      color:#d03925;
      background: #ffffff;
  }
  /************** END SIGNUP BAR ******************/
  </code></pre>
  
  <p><strong>THEME FOOTER.PHP</strong></p>
  
  <pre><code>                &lt;/div&gt;  &lt;!-- fusion-row --&gt;
              &lt;/div&gt;  &lt;!-- #main --&gt;
  
              &lt;?php
              global $social_icons;
  
              if ( strpos( Avada()-&gt;settings-&gt;get( 'footer_special_effects' ), 'footer_sticky' ) !== FALSE ) {
                  echo '&lt;/div&gt;';
              }
  
              // Get the correct page ID
              $c_pageID = Avada::c_pageID();
  
              // Only include the footer
              if ( ! is_page_template( 'blank.php' ) ) {
  
                  $footer_parallax_class = '';
                  if ( Avada()-&gt;settings-&gt;get( 'footer_special_effects' ) == 'footer_parallax_effect' ) {
                      $footer_parallax_class = ' fusion-footer-parallax';
                  }
  
                  echo sprintf( '&lt;div class="fusion-footer%s"&gt;', $footer_parallax_class );
  
                      // Check if the footer widget area should be displayed
                      if ( ( Avada()-&gt;settings-&gt;get( 'footer_widgets' ) &amp;&amp; get_post_meta( $c_pageID, 'pyre_display_footer', true ) != 'no' ) ||
                           ( ! Avada()-&gt;settings-&gt;get( 'footer_widgets' ) &amp;&amp; get_post_meta( $c_pageID, 'pyre_display_footer', true ) == 'yes' )
                      ) {
                      ?&gt;
                          &lt;footer class="fusion-footer-widget-area"&gt;
                              &lt;div class="fusion-row"&gt;
                                  &lt;div class="fusion-columns fusion-columns-&lt;?php echo Avada()-&gt;settings-&gt;get( 'footer_widgets_columns' ); ?&gt; fusion-widget-area"&gt;
  
                                      &lt;?php
                                      // Check the column width based on the amount of columns chosen in Theme Options
                                      $column_width = 12 / Avada()-&gt;settings-&gt;get( 'footer_widgets_columns' );
                                      if( Avada()-&gt;settings-&gt;get( 'footer_widgets_columns' ) == '5' ) {
                                          $column_width = 2;
                                      }
  
                                      // Render as many widget columns as have been chosen in Theme Options
                                      for ( $i = 1; $i &lt; 7; $i++ ) {
                                          if ( Avada()-&gt;settings-&gt;get( 'footer_widgets_columns' ) &gt;= $i ) {
                                              echo sprintf( '&lt;div class="fusion-column col-lg-%s col-md-%s col-sm-%s"&gt;', $column_width, $column_width, $column_width );
  
                                                  if ( function_exists( 'dynamic_sidebar' ) &amp;&amp;
                                                       dynamic_sidebar( 'avada-footer-widget-' . $i )
                                                  ) {
                                                      // All is good, dynamic_sidebar() already called the rendering
                                                  }
                                              echo '&lt;/div&gt;';
                                          }
                                      }
                                      ?&gt;
  
                                      &lt;div class="fusion-clearfix"&gt;&lt;/div&gt;
                                  &lt;/div&gt; &lt;!-- fusion-columns --&gt;
                              &lt;/div&gt; &lt;!-- fusion-row --&gt;
                          &lt;/footer&gt; &lt;!-- fusion-footer-area --&gt;
                      &lt;?php
                      } // end footer wigets check
  
                      // Check if the footer copyright area should be displayed
                      if ( ( Avada()-&gt;settings-&gt;get( 'footer_copyright' ) &amp;&amp; get_post_meta( $c_pageID, 'pyre_display_copyright', true ) != 'no' ) ||
                            ( ! Avada()-&gt;settings-&gt;get( 'footer_copyright' ) &amp;&amp; get_post_meta( $c_pageID, 'pyre_display_copyright', true ) == 'yes' )
                      ) {
                      ?&gt;
                          &lt;footer id="footer" class="fusion-footer-copyright-area"&gt;
                              &lt;div class="fusion-row"&gt;
                                  &lt;div class="fusion-copyright-content"&gt;
  
                                      &lt;?php
                                      /**
                                       * avada_footer_copyright_content hook
                                       *
                                       * @hooked avada_render_footer_copyright_notice - 10 (outputs the HTML for the Theme Options footer copyright text)
                                       * @hooked avada_render_footer_social_icons - 15 (outputs the HTML for the footer social icons)
                                       */
                                      do_action( 'avada_footer_copyright_content' );
                                      ?&gt;
  
                                  &lt;/div&gt; &lt;!-- fusion-fusion-copyright-area-content --&gt;
                              &lt;/div&gt; &lt;!-- fusion-row --&gt;
                          &lt;/footer&gt; &lt;!-- #footer --&gt;
                      &lt;/div&gt; &lt;!-- fusion-footer --&gt;
                  &lt;?php
                  } // end footer copyright area check
              } // end is not blank page check
              ?&gt;
          &lt;/div&gt; &lt;!-- wrapper --&gt;
  
          &lt;?php
          // Check if boxed side header layout is used; if so close the #boxed-wrapper container
          if ( ( ( Avada()-&gt;settings-&gt;get( 'layout' ) == 'Boxed' &amp;&amp; get_post_meta( $c_pageID, 'pyre_page_bg_layout', true ) == 'default' ) || get_post_meta( $c_pageID, 'pyre_page_bg_layout', true ) == 'boxed' ) &amp;&amp;
               Avada()-&gt;settings-&gt;get( 'header_position' ) != 'Top'
  
          ) {
          ?&gt;
              &lt;/div&gt; &lt;!-- #boxed-wrapper --&gt;
          &lt;?php
          }
  
          ?&gt;
  
          &lt;!-- W3TC-include-js-head --&gt;
  
          &lt;?php
          wp_footer();
  
          // Echo the scripts added to the "before &lt;/body&gt;" field in Theme Options
          echo Avada()-&gt;settings-&gt;get( 'space_body' );
          ?&gt;
  
          &lt;!--[if lte IE 8]&gt;
              &lt;script type="text/javascript" src="&lt;?php echo get_template_directory_uri(); ?&gt;/assets/js/respond.js"&gt;&lt;/script&gt;
          &lt;![endif]--&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>THANK YOU</strong></p>