# Insert php generated content into page

**URL:** <https://community.wpbeaverbuilder.com/t/insert-php-generated-content-into-page/16288>\
**Category:** Beaver Builder\
**Created:** [August 27, 2022, 4:51am UTC](https://community.wpbeaverbuilder.com/t/insert-php-generated-content-into-page/16288 "2022-08-27T04:51:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrappy](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/scrappy/32/3758_2.png) [@scrappy](https://community.wpbeaverbuilder.com/u/scrappy)\
**Post date:** [August 27, 2022, 4:51am UTC](https://community.wpbeaverbuilder.com/t/insert-php-generated-content-into-page/16288/1 "2022-08-27T04:51:12Z")

</div>

I’ve been trying to figure out how to do this for a few days now, and think that I’m going down a total waste of time path to get to where I think it should be simple …

I created a Pod to record a very simple ‘schedule’ for when people are working, basically records, per person:

Day of Week / Hours Working / Any Notes for that day

The problem is, how do I pull that up into the page? There is no way to ‘write php code’ to process the data and display it ( security reasons, I understand that ) … so what I’ve been play with is creating a tpl-schedule.php file within the child theme, attached that to a page and writing the code … it works as I want it to, but I’m spending alot of time trying to format things into the site itself, where BB/BB Themer already _have_ all of that information.

There has to be an easier way … I’ve only started to use BB ( took over project from someone that designed it with it ) and have been suitably impressed … I just need to be able to extend things in ways that I seem to be outside of realm …

… long story short, I have seen some folks about about custom modules, and am not afraid to dive into that, but is this the route I should be following ( vs building tpl files in the child theme )?

Short and simple question: is custom module what I want to do for this, or is there a better way that I’m just not finding?

Thanks …

Sample of the code is as follows … its not complicated:

```auto
<?php

  $params = array (
                     'where' => 'week_starting.meta_value = date ( curdate() - weekday(curdate()) )'
                  );

  $mypod = pods( 'schedule' );
  $mypod->find( $params );

?>
  <strong><?php echo date( 'l, F jS, Y', strtotime( 'monday this week' ) ); ?></strong><p />
<?php
  while ( $mypod->fetch() ) {
    if( strlen($mypod->display( 'mon_hours' )) > 0 ) {
      $url = '<a href="/empl/' . strtolower($mypod->display( 'name_of_empl' )) . '">' . $mypod->display( 'name_of_empl' ) . '</a>';
      $hours = " : " . $mypod->display( 'mon_hours' );
      $comments = '';
      if ( strlen ( $mypod->display( 'mon_comments' ) ) > 0 ) {
        $comments = " : " . $mypod->display( 'mon_comments' );
      }
      echo $url . $hours . $comments . "<br />";
    }
  }
?>

```

---

<div class="post-metadata">

**Author:** ![pross](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/pross/32/883_2.png) [@pross](https://community.wpbeaverbuilder.com/u/pross)\
**Post date:** [August 29, 2022, 1:45pm UTC](https://community.wpbeaverbuilder.com/t/insert-php-generated-content-into-page/16288/2 "2022-08-29T13:45:56Z")

</div>

I would suggest you read up on how shortcodes work, you can isert them anywhere.

---

<div class="post-metadata">

**Author:** ![scrappy](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/scrappy/32/3758_2.png) [@scrappy](https://community.wpbeaverbuilder.com/u/scrappy)\
**Post date:** [August 30, 2022, 12:37am UTC](https://community.wpbeaverbuilder.com/t/insert-php-generated-content-into-page/16288/3 "2022-08-30T00:37:43Z")

</div>

What I ended up doing was following the instructions on how to build a module that does what I want, which seems to have worked perfectly.

Is creating a shortcode just a different method of doing the same thing? I found the Codex docs on shortcodes … haven’t tried writing one yet, but understand the concept … is one recommended over the other?
