Quick PHP question regarding previous examples…


Hi there - for a start I just want to say that beans has been AWESOME so far.

I am rather uneducated in PHP and wordpress, most sites I build are like a jigsaw puzzle of examples - due to that, I cannot get my head around the syntax of a few examples - I'm using the template file Thierry supplied for another user, which I have modified to suit, and it works, but I can't tell how!

The PHP close tag is at the start, and the open tag is at the end - here's a sample:

function example_view_pre_footer_content() {
  ?>
  <div class="uk-container-wide uk-container-center">
 <?php echo do_shortcode('[wpdatatable id=1]') ?>
  </div>
  <?php
}

Is the 'function' part creating a PHP function that needs to be closed? If I switch the tags around the page breaks. I'll happily just use it as-is, but I would just like to know why it looks like that!


Quick note - I did do some digging on google but none of my search terms showed up anything other than standard php examples.

Write a reply

Login or register to write a reply, it's free!