Advertisement
WillowDog

Untitled

Feb 24th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <?php
  2. /*This file is part of conference-child, conferencepro child theme.
  3.  
  4. All functions of this file will be loaded before of parent theme functions.
  5. Learn more at https://codex.wordpress.org/Child_Themes.
  6.  
  7. Note: this function loads the parent stylesheet before, then child theme stylesheet
  8. (leave it in place unless you know what you are doing.)
  9. */
  10.  
  11. function conference_child_enqueue_child_styles() {
  12. $parent_style = 'parent-style';
  13. wp_enqueue_style($parent_style, get_template_directory_uri() . '/style.css' );
  14. wp_enqueue_style(
  15. 'child-style',
  16. get_stylesheet_directory_uri() . '/style.css',
  17. array( $parent_style ),
  18. wp_get_theme()->get('Version') );
  19. }
  20. add_action( 'wp_enqueue_scripts', 'conference_child_enqueue_child_styles' );
  21.  
  22. /*Write here your own functions */
  23.  
  24.  
  25.  
  26.  
  27. function mycustom_filter_gettext( $translated, $original, $domain ) {
  28.  
  29. // This is an array of original strings
  30. // and what they should be replaced with
  31. $strings = array(
  32. 'Attendee %d' => 'Player %d',
  33. 'Register' => 'Sign up',
  34. 'Confirm and go to payment page' => 'Complete registration',
  35. 'click here to add a new state/province' => 'click here to enter address outside US/Canada',
  36. // Add some more strings here
  37. );
  38.  
  39. // See if the current string is in the $strings array
  40. // If so, replace its translation
  41. if ( isset( $strings[$original] ) ) {
  42. // This accomplishes the same thing as __()
  43. // but without running it through the filter again
  44. $translations = get_translations_for_domain( $domain );
  45. $translated = $translations->translate( $strings[$original] );
  46. }
  47.  
  48. return $translated;
  49. }
  50.  
  51. add_action(‘wp_print_scripts’, ‘conferenepro_child_custom_js’);
  52. function conferenepro_child_custom_js(){
  53. wp_dequeue_script(‘cpt-jquery-main’);
  54. wp_register_script( ‘cpt-jquery-main-child1’, get_stylesheet_directory_uri() . ‘/assets/js/jquery.main.js’, array(
  55. ‘jquery’,
  56. ‘cpt-countdown’,
  57. ‘cpt-isotope’,
  58. ‘cpt-google-maps’,
  59. ‘cpt-nicescroll’,
  60. ‘cpt-swiper’,
  61. ‘cpt-select’,
  62. ‘cpt-youtubebackground’
  63. ), false, true);
  64. wp_localize_script(‘cpt-jquery-main-child1’, ‘cptJS’, array(‘ajax_url’ => admin_url(‘admin-ajax.php’), ‘is_fe’ => ef_fe_vue_prop(true, false)));
  65. wp_enqueue_script(‘cpt-jquery-main-child1’);
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement