Advertisement
arie_cristianD

add shortcode to display JNews Article Ads options

Jun 29th, 2025
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. /**
  2.  * Above Ads Option Shortcode.
  3.  * Use [custom_above_ads] to show this elmeent on your pages.
  4.  */
  5. function custom_above_ads() {
  6.     ob_start();
  7.     ?>
  8.  
  9.         <div class="jeg_ad jeg_article jnews_article_top_ads">
  10.             <?php do_action( 'jnews_article_top_ads' ); ?>
  11.         </div>
  12.     <?php
  13.     return ob_get_clean();
  14. }
  15.  
  16. /**
  17.  * Top Ads Option Shortcode.
  18.  * Use [custom_top_ads] to show this elmeent on your pages.
  19.  */
  20. function custom_top_ads() {
  21.     ob_start();
  22.     ?>
  23.         <?php do_action( 'jnews_single_post_before_content' ); ?>
  24.     <?php
  25.     return ob_get_clean();
  26. }
  27.  
  28. /**
  29.  * Bottom Ads Option Shortcode.
  30.  * Use [custom_bottom_ads] to show this elmeent on your pages.
  31.  */
  32. function custom_bottom_ads() {
  33.     ob_start();
  34.     ?>
  35.         <?php do_action( 'jnews_single_post_after_content' ); ?>
  36.     <?php
  37.     return ob_get_clean();
  38. }
  39.  
  40. /**
  41.  * Below Ads Option Shortcode.
  42.  * Use [custom_below_ads] to show this elmeent on your pages.
  43.  */
  44. function custom_below_ads() {
  45.     ob_start();
  46.     ?>
  47.         <div class="jeg_ad jeg_article jnews_article_bottom_ads">
  48.             <?php do_action( 'jnews_article_bottom_ads' ); ?>
  49.         </div>
  50.     <?php
  51.     return ob_get_clean();
  52. }
  53.  
  54.  
  55.  
  56. add_shortcode( 'custom_above_ads', 'custom_above_ads' );
  57. add_shortcode( 'custom_top_ads', 'custom_top_ads' );
  58. add_shortcode( 'custom_bottom_ads', 'custom_bottom_ads' );
  59. add_shortcode( 'custom_below_ads', 'custom_below_ads' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement