Advertisement
fauzanjeg

Add MKTG Code

May 21st, 2021
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. /* Add Code HTML After Single Post Content */
  2. function add_mktg_code_below_article() {
  3.     $html = '<div data-contentexchange-widget=".." data-contentexchange-source=".."></div>';
  4.  
  5.     echo $html;
  6. }
  7.  
  8. add_action( 'jnews_single_post_after_content', 'add_mktg_code_below_article' );
  9.  
  10. /* Add Code HTML After Category Content */
  11. function add_mktg_code_below_category_content() {
  12.     $html = null;
  13.  
  14.     if ( is_archive() && is_category() ) {
  15.         $html = '<div data-contentexchange-widget=".." data-contentexchange-source=".."></div>';
  16.     }
  17.  
  18.     echo $html;
  19. }
  20.  
  21. add_action( 'jnews_after_main', 'add_mktg_code_below_category_content' );
  22.  
  23. /* Add Code Script Before The Closing Body Tag */
  24. function add_mktg_script_in_footer() {
  25.     $html = '<script src="https://URL/static/tracker.js" async></script>';
  26.  
  27.     echo $html;
  28. }
  29.  
  30. add_action( 'wp_footer', 'add_mktg_script_in_footer' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement