Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. add_action( 'the_post', 'campaign_remove_nextpage', 99);
  2.  
  3. function campaign_remove_nextpage ( $post ) {
  4.  
  5. if (($_GET['utm_campaign']== 'Facebook' || $_GET['utm_campaign']== 'Twitter') && (false !== strpos( $post->post_content, '<!--nextpage-->' )) )
  6. {
  7. }
  8. else {
  9. $totalArticlesPages = substr_count($post->post_content, '<!--nextpage-->');
  10. // Google: not paginated
  11. // Direct: not paginated
  12. // Camp: paginated
  13.  
  14. // Reset the global $pages:
  15. $GLOBALS['pages'] = [ $post->post_content ];
  16.  
  17. // Reset the global $numpages:
  18. $GLOBALS['numpages'] = 0;
  19.  
  20. // Enable multipage
  21. $GLOBALS['multipage'] = false;
  22. }};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement