1

I am trying to put a pluign into a short code it works on the page but when i try to insert it into a modal popup it doesnt render correct at all.

<div id="thanks" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
    <div class="modal-content">
   <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">Redeem Points</h4>
    </div>
    <div class="modal-body">

    <?php echo do_shortcode['go_greenredempoints'];?>
    </div><!-- End of Modal body -->
    </div><!-- End of Modal content -->
    </div><!-- End of Modal dialog -->
</div><!-- End of Modal -->

This is my show form routine in my plugin :

function show_form(){

echo "<form class='form-horizontal'  class='contact' name='redemmpointsForm' id='redemmpointsForm' >";
 echo " <div class='form-group'>";
 echo "<h3>You may only redeem the maxium points of : <?php echo $maxpoints;?></h3>";
   echo "<input type='hidden' name='playerid' value='<?php echo $playerId;;?>' />";
   echo "<input type='number'  valuemax='<?php echo $maxpoints;?>' name='points' id='points' class='form-control' placeholder='How many points do you wish to redeem.' />";
  echo "<label class='control-label col-md-4' for='Comments'>Comments?</label>";
   echo "<input type='text' name='comments' />";

   echo "     </div>";
    echo "    <div class='form-group'>";
    echo "            <div class='col-md-6'>";

     echo "                <input type='button' class='btn btn-success' name='submit' id='submit' Text='Submit'>";
   echo "   <a     <a href='#' class='btn' data-dismiss='modal'>Close</a>";

       echo "         </div>";
      echo "      </div>";
echo "</form>";


}

and I defined my shortcode as

add_shortcode( 'go_greenredempoints', 'gs_redeemplugin' );

function gs_redeemplugin() {
    ob_start();
    show_form();
    return ob_get_clean();
}

?>

  • It is not clear how all of these pieces fit together – s_ha_dum Oct 31 '15 at 23:32
  • i solved it anyway took it out put it into a plugin and works wordpress weird sometimes – David Buckley Nov 1 '15 at 0:36
1

Your code is wrong, change

<?php echo do_shortcode['go_greenredempoints'];?>

with

<?php echo do_shortcode('[go_greenredempoints]');?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.