Guest User

Untitled

a guest
Mar 8th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99);
  3. function child_enqueue_styles() {
  4. $parent_style = 'parent-style';
  5. wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
  6. wp_enqueue_style( 'child-style',get_stylesheet_directory_uri() . '/custom.css', array( $parent_style ));
  7. }
  8. if ( get_stylesheet() !== get_template() ) {
  9. add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
  10. update_option( 'theme_mods_' . get_template(), $value );
  11. return $old_value; // prevent update to child theme mods
  12. }, 10, 2 );
  13. add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
  14. return get_option( 'theme_mods_' . get_template(), $default );
  15. } );
  16. }
  17.  
  18. add_action('wp_footer', 'ava_custom_script');
  19. function ava_custom_script(){
  20. ?>
  21. <script type=”text/javascript”>
  22. (function($) {
  23. function a() {
  24. $('.av-masonry-entry:not(“.lightbox-added”)').each( function() {
  25. $(this).attr('target', '_blank');
  26. $(this).attr('rel', 'nofollow');
  27. });
  28. }
  29.  
  30. a();
  31. })(jQuery);
  32. </script>
  33. <?php
  34. }
  35.  
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment