Home / RSS Feeds / enr_weekly_digest
Duplicate Snippet

Embed Snippet on Your Site

enr_weekly_digest

WPCode “Custom Snippet” that auto loads enr_weekly_digest in MailPoet every weekmakes possible not to paste the long code each time the nwsletter is published.

Patrick Nzeogu PRO
<10
Code Preview
php
<?php
<?php
// Shortcode: [enr_weekly_digest]
// Outputs a unified Weekly Digest (Global • Nigeria • Africa) + CTA
// NOTE: requires MailPoet "Automatic Latest Content" shortcode support.
// If your shortcode name differs, adjust [automatic_posts] below.
add_shortcode('enr_weekly_digest', function () {
  ob_start(); ?>
  <div style="background:#F7FAFC; padding:20px; border-radius:8px; font-family:Arial, sans-serif;">
    <h2 style="text-align:center; margin:0 0 8px; font-size:22px; color:#111;">
      EnergyNewsRatings Weekly Digest
    </h2>
    <hr style="width:40%; border:0; border-top:1px solid #E2E8F0; margin:12px auto;">
    <!-- Global Energy -->
    <h3 style="margin:20px 0 6px;">🌍 Global Energy — market moves, geopolitics & fuels</h3>
    <?php echo do_shortcode('[automatic_posts category="global-energy" show_image="true" image_size="medium" layout="list" featured_image_position="left" show_excerpt="true" excerpt_length="28" readmore="true" readmore_label="Read more →" posts="3" orderby="date" order="DESC" title_as_links="true" title_format="h3"]'); ?>
    <!-- Nigeria Energy -->
    <h3 style="margin:24px 0 6px;">🇳🇬 Nigeria Energy — production, policy & prices</h3>
    <?php echo do_shortcode('[automatic_posts category="nigeria-energy" show_image="true" image_size="medium" layout="list" featured_image_position="left" show_excerpt="true" excerpt_length="28" readmore="true" readmore_label="Read more →" posts="3" orderby="date" order="DESC" title_as_links="true" title_format="h3"]'); ?>
    <!-- Africa Energy -->
    <h3 style="margin:24px 0 6px;">🌍 Africa Energy — renewables, grid projects & investment</h3>
    <?php echo do_shortcode('[automatic_posts category="africa-energy" show_image="true" image_size="medium" layout="list" featured_image_position="left" show_excerpt="true" excerpt_length="28" readmore="true" readmore_label="Read more →" posts="3" orderby="date" order="DESC" title_as_links="true" title_format="h3"]'); ?>
    <!-- CTA -->
    <div style="text-align:center; margin-top:30px;">
      <a href="https://energynewsratings.com/?utm_source=enr-newsletter&utm_medium=email&utm_campaign=weekly-digest&utm_content=cta-bottom"
         style="display:inline-block; background:#0A7CFF; color:#fff; padding:12px 20px; border-radius:6px; font-size:16px; text-decoration:none;">
        Visit ENR for More Energy Stories
      </a>
    </div>
  </div>
  <?php
  return ob_get_clean();
});

Comments

Add a Comment