Static image for embedded YouTube video instead of blank player?
Try adding another attribute See the Codex
Try adding another attribute See the Codex
You have slight timing issues because you generate title first (in constructor call), but postpone text domain load to later (init at default priority). Text domain mus be loaded for __() to translate correctly. Those are not “lazy”, they generate and return strings right where they are called. Text domain should be loaded very early, … Read more
Use This <?php class Game_Info_Widget extends WP_Widget { /** * Register widget with WordPress. */ public function __construct() { parent::__construct( ‘game_info_widget’, // Base ID ‘Game – Info’, // Name array(‘description’ => __(‘Game – Info’, ‘text_domain’),) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget … Read more
I believe if you add ‘title’ field to the form() (and update()) method this will be displayed in the admin interface. Traditionally this would also be used in the widget() method, but is not required. function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance[‘title’] = strip_tags($new_instance[‘title’]); return $instance; } function form( $instance ) { … Read more
You should make the check inside the widget class, unless you don’t have a choice. The example in the codex is pretty much what you’re looking for: class cbs_map_widget extends WP_Widget{ function cbs_map_widget(){ $this->WP_Widget(‘cbsmaps’, __(‘Widget Name’), array(‘classname’ => ‘cbsmaps’, ‘description’ => __(‘whatever’))); … add_action(‘wp_enqueue_scripts’, array(&$this, ‘js’)); } function js(){ if ( is_active_widget(false, false, $this->id_base, true) … Read more
Simply create a new widget & register it – /* Create a new Widget */ class WPSE180059_Widget extends WP_Widget { public function __construct() { $widget_ops = array( ‘classname’ => ‘widget_wpse180059’, ‘description’ => __( ‘A Custom Widget’) ); parent::__construct(‘wpse180059’, __(‘WPSE180059 Widget’), $widget_ops); } public function widget( $args, $instance ) { $title = apply_filters( ‘widget_title’, empty($instance[‘title’]) ? … Read more
You can add a “Meta Box” to the admin screen of edit post/page. WordPress have the function add_meta_box function for this job. The content inside this meta box is your choice. You can define, on which area of the edit screen will add the box, like sidebar or central area. Also you have the benefits, … Read more
This is entirely up to you. Both approaches should do the same thing. I really do think that you having trouble with correct implementation of your first choice/approach. What you are trying to do is correct using a separate template for your slideshow and then calling it with get_template_part(). The problem it seems is your … Read more
Thank you all. I just took code from codex, I’ve changed id footerBoxOne to footer-box-1 for all four widgets, and it’s working now. I guess uppercase chars were the problem
There are two ways to see it: Sidebar as a general area of site layout Sidebar as container, filled with WordPress widgets Or maybe combination of the two. The prime reason to use WordPress widgets is that they provide roughly consistent experience, can be easily used multiple times, and can be enhanced with related functionality … Read more