WordPress shortcode with html and php content

Hi i want do shortcode for one of the content form plugin and theme.

So plugin has:

<section id="standings" class="admin-section">

<h2><?php esc_html_e('List of groups', 'pixieclashpanel') ?></h2>
<p class="demolink"><span class="spliter">|</span> <a target="_blank" href="<?php echo PIXIECLASHPANEL_LOC_URL . 'assets/images/Teams&Players.jpg' ?>"><?php esc_html_e('Click here', 'pixieclashpanel') ?></a> <?php esc_html_e('to see which element you are changing', 'pixieclashpanel') ?></p>
<p class="section-description">
    <?php esc_html_e('Down below you will be able to see a list of groups. To edit a group click the pencil icon. To delete a group click the X icon.', 'pixieclashpanel') ?>

and theme has function to this:

function pixieclash_standings($id) {
global $tables;

if(!$id) {
    return false;

// Get Standing Groups
$sponsors = pixieclash_select_all($tables['standings'], ['group_id', $id], ['points', 'DESC']);
return $sponsors;}

I didn’t past full code of section because of creatrs etc…

I don’t really know how to do shorcode of this thing.

I tried to create add_shorcode(‘table’, ‘name of this function’); (under the function) but this not work for me. maby i need to include the file or something. I don’t know 🙂

Read more here: WordPress shortcode with html and php content

Leave a Reply

Your email address will not be published. Required fields are marked *