functions.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Theme functions. Initializes the Vamtam Framework.
  4. *
  5. * @package vamtam/consulting
  6. */
  7. require_once get_template_directory() . '/vamtam/classes/framework.php';
  8. new VamtamFramework( array(
  9. 'name' => 'consulting',
  10. 'slug' => 'consulting',
  11. ) );
  12. // only for one page home demos
  13. function vamtam_onepage_menu_hrefs( $atts, $item, $args ) {
  14. if ( 'custom' === $item->type && 0 === strpos( $atts['href'], '/#' ) ) {
  15. $atts['href'] = $GLOBALS['vamtam_inner_path'] . $atts['href'];
  16. }
  17. return $atts;
  18. }
  19. if ( ( $path = parse_url( get_home_url(), PHP_URL_PATH ) ) !== null ) {
  20. $GLOBALS['vamtam_inner_path'] = untrailingslashit( $path );
  21. add_filter( 'nav_menu_link_attributes', 'vamtam_onepage_menu_hrefs', 10, 3 );
  22. }
  23. remove_action( 'admin_head', 'jordy_meow_flattr', 1 );
  24. require_once VAMTAM_DIR . 'customizer/setup.php';
  25. require_once VAMTAM_DIR . 'customizer/preview.php';
  26. function vamtam_ninja_starter_form( $contents ) {
  27. return vamtam_silent_get_contents( VAMTAM_SAMPLES_DIR . 'ninja-forms/1.nff' );
  28. }
  29. add_filter( 'ninja_forms_starter_form_contents', 'vamtam_ninja_starter_form' );
  30. // this filter fixes some invalid HTML generated by the third-party plugins
  31. add_filter( 'vamtam_escaped_shortcodes', 'vamtam_shortcode_compat_fix' );
  32. function vamtam_shortcode_compat_fix( $codes ) {
  33. $codes[] = 'gallery';
  34. $codes[] = 'fl_builder_insert_layout';
  35. return $codes;
  36. }
  37. // Envato Hosted compatibility
  38. add_filter( 'option_vamtam-envato-license-key', 'vamtam_envato_hosted_license_key' );
  39. function vamtam_envato_hosted_license_key( $value ) {
  40. if ( defined( 'SUBSCRIPTION_CODE' ) ) {
  41. return SUBSCRIPTION_CODE;
  42. }
  43. return $value;
  44. }
  45. if ( class_exists( 'Vamtam_Importers' ) ) {
  46. Vamtam_Importers::set_menu_locations();
  47. }
  48. @ini_set( 'upload_max_size' , '112M' );
  49. @ini_set( 'post_max_size', '112M');
  50. @ini_set( 'max_execution_time', '300' );