Advertisement
Beee

child-functions.php

Feb 7th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. <?php
  2.     class awempire extends WP_Widget {
  3.  
  4.         public function __construct() {
  5.             // Instantiate the parent object
  6.             parent::__construct(
  7.                 'awempire',
  8.                 'SD8 AWEmpire',
  9.                 array(
  10.                     'description' => 'AWEmpire ads'
  11.                 )
  12.             );
  13.         }
  14.  
  15.         public function widget( $args, $instance ) {
  16.  
  17.             echo $args['before_widget'];
  18.             echo '<p>This is some text in a widget which won\'t show if WPML is activated.</p>';
  19.             echo $args['after_widget'];
  20.         }
  21.     }
  22.  
  23.     function my_theme_enqueue_styles() {
  24.         wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
  25.     }
  26.     add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
  27.  
  28.     function sd_register_widgets() {
  29.         register_widget( 'awempire' );
  30.     }
  31.     add_action( 'widgets_init', 'sd_register_widgets' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement