• Skip to main content

Julian Thomas Screawn

B.A. ,B.ED. ,M.ED.

  • Home
  • About
  • Websites
  • Resources
  • Coding
  • Contact

How to create shortcodes in functions.php

2025/05/16

function be_biz_grid() {


$content="Welcome to the biz grid."
return $content;

}
add_shortcode('biz-grid', 'be_biz_grid'); 


//using ob_start there is no need to store everything in the content variable.

function be_biz_grid() {
ob_start();

... code here  ...
$content = ob_get_clean();
return $content;
}
add_shortcode('biz-grid', 'be_biz_grid'); 



Filed Under: Wordpress

Copyright © 2025 · Servicing Moncton, Dieppe, Riverview and beyond! · Moncton Meditation · Moncton English Tutor