Guest User

Custom Functions PHP in GP

a guest
Apr 3rd, 2016
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Generate child theme functions and definitions
  4.  *
  5.  * @package Generate
  6.  */
  7.  function generate_secondary_navigation_shortcode() {
  8.       return generate_secondary_navigation_position();
  9. }
  10. add_shortcode( 'generate_secondary_navigation', 'generate_secondary_navigation_shortcode' );
  11. ?>
  12. <!-- Strips More tag when Excerpt is used on post -->
  13. <?php
  14. add_filter('generate_more_tag','generate_disable_more_tag');
  15. function generate_disable_more_tag()
  16. {
  17.       return false;
  18. }
  19. ?>
  20. <!-- End More tag -->
  21. <!-- Add Previous Next buttons to bottom of Pages -->
  22. <?php add_action( 'generate_after_content','generate_add_page_next_prev' );
  23. function generate_add_page_next_prev()
  24. {
  25.  
  26.       if ( ! is_page() )
  27.             return;
  28. ?>
  29. <div class="prev-next">
  30. <?php
  31. previous_post_link( '<div class="nav-previous prev-next-button"><span class="prev" title="' . __('Previous','generate') . '">%link</span></div>', 'Previous' );
  32.  
  33. next_post_link( '<div class="nav-next prev-next-button"><span class="next" title="' . __('Next','generate') . '">%link</span></div>', 'Next' );
  34. ?>
  35. </div>
  36. <?php
  37. } ?>
  38. <!-- End Previous Next buttons -->
  39. <!-- Add PopMake script to footer -->
  40. <?php
  41. add_action( 'wp_footer', 'my_custom_popup_scripts', 500 );
  42. function my_custom_popup_scripts() { ?>
  43.     <script type="text/javascript">
  44.     (function ($) {
  45.         // Your custom code goes here.
  46.         jQuery('#popmake-266')
  47.     .on('popmakeBeforeOpen', function () {
  48.         var $iframe = jQuery('iframe', jQuery(this)),
  49.             src = $iframe.prop('src');
  50.         $iframe.prop('src', '').prop('src', src + '?autoplay=1');
  51.     });
  52.         // Custom Code End.
  53.     }(jQuery))
  54.     </script><?php
  55. }
RAW Paste Data