Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: ACF-Helper
- * Plugin URI: #
- * Description: Custom plugin for ACF.
- * Author: Monzur Alam
- * Version: 1.0.0
- * Text Domain: acf-helper
- * License: GPLv2
- * License URI: https://www.gnu.org/licenses/gpl-2.0.html
- */
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
- if (!function_exists('acf_helper_content')) {
- function acf_helper_content($content){
- // now this work on article & page.
- if ( is_singular('post') || is_page() ) {
- ob_start();
- ?>
- <div class="contenitore">
- <div class="container">
- <div class="titolo">
- <?php
- if (get_field('tipologia')) {
- echo '<h4>Area di produzione</h4>';
- } ?>
- </div>
- <div id="scheda-dettagli-vino" class="sezione">
- <?php {
- echo '<img src="/icone/area-di-produzione.png" />', '<img src="/wp-content/plugins/acf-helper/icone/divisore.png" />';
- echo esc_html(the_field('tipologia'));
- } ?>
- </div>
- </div>
- </div>
- <div class="contenitore">
- <div class="container">
- <div class="titolo">
- <?php
- if (get_field('tipologia')) {
- echo '<h4>Tipologia</h4>';
- } ?>
- </div>
- <div id="scheda-dettagli-vino" class="sezione">
- <?php {
- echo '<img src="/wp-content/plugins/acf-helper/icone/tipologia.png" />', '<img src="/wp-content/plugins/acf-helper/icone/divisore.png" />';
- echo esc_html(the_field('tipologia'));
- } ?>
- </div>
- </div>
- </div>
- <?php
- return $content . ob_get_clean();
- }
- }
- add_filter('the_content', 'acf_helper_content');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement