Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'the_post', 'campaign_remove_nextpage', 99);
- function campaign_remove_nextpage ( $post ) {
- if (($_GET['utm_campaign']== 'Facebook' || $_GET['utm_campaign']== 'Twitter') && (false !== strpos( $post->post_content, '<!--nextpage-->' )) )
- {
- }
- else {
- $totalArticlesPages = substr_count($post->post_content, '<!--nextpage-->');
- // Google: not paginated
- // Direct: not paginated
- // Camp: paginated
- // Reset the global $pages:
- $GLOBALS['pages'] = [ $post->post_content ];
- // Reset the global $numpages:
- $GLOBALS['numpages'] = 0;
- // Enable multipage
- $GLOBALS['multipage'] = false;
- }};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement