PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.7
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / admin / page-builder / beaver / includes / frontend.php

frontend.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at admin/page-builder/beaver/includes/frontend.php

44 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Beaver Builder - Smart Post Show Module Frontend Template
4 *
5 * This file is automatically loaded by Beaver Builder when
6 * rendering the module output on the frontend.
7 *
8 * The $module, $id, and $settings variables are available
9 * automatically by Beaver Builder's rendering engine.
10 *
11 * @since 4.0.0
12 * @package Smart_Post_Show
13 *
14 * @var SPSB_Beaver_Smart_Post_Module $module The module instance.
15 * @var string $id The module's unique node ID.
16 * @var object $settings The module's saved settings.
17 */
18
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit; // Exit if accessed directly.
21 }
22
23 // Get the selected template ID from module settings.
24 $template_id = isset( $settings->template_id ) ? (int) $settings->template_id : 0;
25
26 // Show a placeholder if no template has been selected.
27 if ( empty( $template_id ) ) : ?>
28 <div style="
29 text-align: center;
30 padding: 20px;
31 border: 2px dashed #ccc;
32 color: #999;
33 font-size: 14px;
34 ">
35 <?php esc_html_e( 'Please select a Smart Post Show Template', 'post-carousel' ); ?>
36 </div>
37 <?php else : ?>
38 <div class="sp-smart-post-builder-wrap" data-builderTemplateId="<?php echo esc_attr( $template_id ); ?>">
39 <?php
40 // Execute the Smart Post Show shortcode and output the result.
41 echo do_shortcode( '[smart_post id="' . $template_id . '"]' );
42 ?>
43 </div>
44 <?php endif; ?>