Widget Wrangler Tricks – Putting Widgets Directly Into Your Page

With Widget Wrangler Tricks, we will introduce useful things you can do with the new Widget Wrangler that maybe have slipped by your attention.

You can put Widgets directly onto your page now, and you can manipulate them however you would manipulate page elements.  Now, you may wonder why this would even be useful – after all, you could always just add the same content as would be in the widget directly to the page.  However, what if you want to have a very special place to put your site’s calendar, without having to do custom theming?  Let’s take a look at that.

Widget Wrangler Tricks - Copy CalendarFirst, let’s clone a copy of your wordpress calendar.  This is very easy to do in Widget Wrangler.  All you have to do is go to “Copy WP Widget” in your Widget Wrangler menu.  This will bring up a list of all the default & contributed widgets on your site.  Choose the calendar, give it an appropriate name, and click “Create.”

As mentioned before, you can obviously do as much as you want with the built-in WYSIWYG editor, but there are limitations to what you can accomplish based on your coding experience. Not everyone who downloads wordpress to use as a blog or basic site can use php code to get exactly the results on a page they see in their head. However, with Widget Wrangler, you don’t have to. You can just insert your Widgets directly onto the page. Just make sure you have the tinyMCE Shortcode Button option enabled in your Widget Wrangler settings. Now, when you edit a page, you will see the WidgetWrangler plugin on the edit page. Click on that to show a drop down of all your widgets. When you click on one of the widgets, it will put the shortcode for that widget in whatever spot your cursor is presently located. As you can see in the below images, I have inserted the widget (and another one that I created, called Newsletter Signup) into a table, displayed between two separate paragraphs.

Widget Wrangler Tricks - TinyMCE Plugin on WYSIWYG Page Widget Wrangler Tricks - Final Results

Hopefully this will be useful to you! Check back often for more Widget Wrangler tricks.

Example Widget: Submenu of the Current Page

This is a simple and common widget a WordPress admin would want to create.

Steps

1. Create a new widget in the Widget Wrangler system.
2. Check: Enable Advanced Parsing
3. Check: Template Advanced Parsing Area

Place the following code in your Advanced Parsing area.

<?php
// wp_list_pages() arguments
$args = array(
  'child_of' => get_post_parent_id($post),
  'echo' => 0,
  'title_li' => '',
);
if($children = wp_list_pages($args)){
  // return an array with title and content
  return array('title' => 'Learn More' ,'content' => '<ul>'.$children.'</ul>');
}
?>

This executes the WordPress function wp_list_pages() using the currently displayed post as the parent page, and returns the results as the content of the widget.

Where Can I Find My Widget Wrangler License Key?

Your Widget Wrangler pro license key can be found by going to the Widget Wrangler Settings page in your install.

From the Dashboard go into the Settings page of the Widget Wrangler menu. On that page select License from the bottom of the left hand sidebar. This page will list your license key and whether or not it is active.

If you need to move your license to another site, for instance from a development site to the live version, you can deactivate the license. Then go into the same page on your new site and activate the license with the same key.

Each license can only be active on one site at a time. For large scale development multiple licenses are recommended. For more information take a look at our Widget Wrangler pro pricing page.

Can I Use Existing WordPress Widgets with Widget Wrangler?

For the most part, yes. Widget Wrangler can copy widgets designed for WordPress 3+. To use these widgets to into the Dashboard. Select “Copy WP Widget” in the Widget Wrangler menu.

This page shows a list of all widgets that can be copied and wrangled. We need to make a copy of the normal WordPress widget because Widget Wrangler stores more information about where and how a widget is displayed. This Widget Wrangler copy will now be available to place in all of your corrals.

If you install a new plugin that provides widgets make sure you revisit the Copy WP Widget page to make a copy of the new widget.

Some widgets that were programmed for much older versions of WordPress may not be able to be copied. If you have an older plugin and the widget it provides isn’t showing up in the Copy WP Widget page update the older plugin. Then you should be able to proceed as normal.

What is a Corral in Widget Wrangler?

A Corral is an arbitrary container for widgets. Something similar in WordPress is “sidebars”. Corrals can have any number of widgets and multiple corrals can appear in a single sidebar if needed.

For example, we have a site that has a sidebar. In this sidebar we want to have a newsletter signup form, also a description above the form. Then we want to display an ad and below that we want to show our social media links.

So our first corral we would create would be the Newsletter corral. Next we would make an Ad corral. Finally we’d make a Social Media corral.

Now we have the ability to place widgets into these corrals on the Presets page. We would want these to show up everywhere so we’d update the Default Preset.

On the Preset page all of the wranglable widgets show up, ready for placement. All we would have to do is drag our newsletter description and newsletter signup widget into the newsletter corral. Then drag the ad widget into the ad corral and finish it up by putting the social media widget into its corral.

Of course all of these can be overridden on each page or post if you wanted to make any specific changes for single pages.

How Do I Hide The Title of a Widget?

Widget Wrangler allows you to do some advanced parsing on widgets in your corrals. But we can also use it for some not so advanced parsing.

To remove the title from a widget we need to head over to the Dashboard. From the Dashboard select Widget Wrangler and then go to All Widgets.

Choose the widget whose title you want hidden and select edit. Scroll down to the Options section and click on Enable Advanced Parsing. This will tell the widget to evaluate any logic you put into the Advance Parsing text area before displaying your widget.

We aren’t going to use any complex logic in there today, we just want to display the content without the title. Just put this into the text area:
{{content}}

If you look a bit farther down the page there is an Advanced Help section that explains what we just did. In the the Advanced Parsing area we can control the output of the widget. To display the widget as normal we would just add {{title}} above the {{content}} we put in before.

For real flexibility you can put php code directly into the Advanced Parsing area (wrapped in <?php tags of course) to determine if you wanted to display the title or the content. In php you also have access to the full $widget object for some serious control.

Introducing Presets!

Widget Wrangler makes keeping track of your widgets a breeze but do you ever wish you could just make a setting that you could apply to each page as a default? Well now you can with the new Preset feature.

Presets allow you to put widgets into contexts that you can reuse around your site without having to create a new corral. Download the new version of Widget Wrangler and give it a spin!