Tag Info

Hot answers tagged

2

Add a widget area to your single.php, front-page.php, home.php or whatever you want.. template's theme file. Than at the back-end go to Appearance > Widgets and move the widget to the widget area you just created.


2

I've did a quick test on just changing the option and it seems to work. What I did is: Wrote a widget that has just 2 fields: "Title" and "Name". Add several instances of this widget to my sidebars. Been sure that they are shown correctly in frontend. Edited the class to use 3 fields: "Title" and "First Name" (to replace "Name") and added "Last Name". ...


2

is_author() is only for Archive pages. Quote from the Codex: is_author() checks if an Author archive page is being displayed So viewing a single Post or Page isn't going to get a TRUE from is_author(). I think you'll want something more like this: global $post,$current_user; // get the global variables to check get_currentuserinfo(); // get ...


1

Go to Settings -> SiteOrigin Page Builder. Enable "Bundled Widgets" and save settings. Embedded Videos (PB) should be available now.


1

I believe that if you are not going to do a massive sql insert (which I think is likely just as efficient) that you need to go ahead and utilize the plugin api and at the time of the button being pressed, create them. I think it's pretty clear your choice is either to create the widgets on the fly, or to import through an sql insert. ...


1

Just to weigh in from a different angle - rather than auto-upgrade all settings on plugin update, simply check for an "old" setting & map to "new" settings on-the-fly: function widget( $args, $instance ) { if ( isset( $instance['old_setting'] ) ) $instance = self::_version_compat( $instance ); } static function _version_compat( $instance ) ...


1

You are stomping on the global wordpress posts with your plugin. Doing your wp_query call and then calling $recent_articles_wtb->the_post(); means that later (after your loop), you will want to call wp_reset_postdata(); # Thanks Milo That should reset the global $current_post and $post objects.


1

The Title of this post is for unregistering widgets not really sidebars, though I am glad the user got what they were looking for. For those searching for how to unregister widgets using a child-theme where the widget was registered in the parent theme, you can do that with this: Assuming the Parent Theme's Widget is registered at the widgets_init hook, all ...



Only top voted, non community-wiki answers of a minimum length are eligible