Chunks of Useful Code

Posts Tagged "WordPress"

Easily Add Widgets to Pages and Posts in WordPress

By on Nov 3, 2017 in Blog | 0 comments

When it comes to WordPress and widgets, there’s a single question that folk want the answer to; How do I add a widget to my page? There are a few ways to achieve this, ranging from low level code, using shortcodes, right up to using the visual editor. We’re going to look at the simplest route here, one that requires no code, no copying and pasting of shortcodes, and no need to know CSS to have our widgets laid out responsively, in columns. Our Task Let’s say we have a WordPress site, and we want to create a page that has some generic text content, but half way down we also want show some widgets. We’d like to show two in fact, and we’d like them to be displayed side by side on most screens, but one underneath the other on smaller screens. Step 1 – Install the Widgets on Pages Plugin The Widgets on Pages plugin was built specifically for this scenario, and this demo will use that plugin. The demo will also use the Pro version, that includes visual editor support and the ability to arrange widgets in columns (without the need for knowing any CSS). Get Widgets on Pages Now Step 2 – Create a new Sidebar for our Widgets With the Widgets on Pages plugin installed we now have the ability to create an unlimited number of sidebars through the standard admin screens. These sidebars could be used in our theme, through the use of it’s template tags, but they can also be used to add widgets to posts and pages content. I’ve created a new sidebar – or Turbo Sidebar, as they’re known in Widgets on Pages – called Basic Widgets Demo. I have some options that would allow me to automatically add the contents of this sidebar to either the header, content, or footer of all posts and/or pages, but I’m not needing that for this example.   Step 3 – Add our Widgets Our new Basic Widgets Demo sidebar is now visible in the standard WordPress widgets admin screen. I’m going to add a couple of widgets, a calendar, and a tag cloud. These add dragged onto the new sidebar, just as you...

Read More

Making the most of WordPress 4.8 Widgets

By on Jun 11, 2017 in News | 0 comments

With WordPress 4.8 “Evans“, we welcome 3 new Widgets into the core WordPress offering, along with an update to the basic Text Widget. Here’s a quick demo of how the Widgets look, using the Widgets on Pages plugin to display them in this post. Updated Text Widget Some content using the new text widget. And a link. And some bullets An Image WidgetA PlantUML generated imageAn Audio Widget https://datamad.co.uk/wp-content/uploads/2017/03/Pim-Poy.wavVideo Widget https://www.youtube.com/watch?v=w2LfCihCqRI We can see here a Text Widget, that has been populated with it’s new visual editor. In the example above I’ve used it to add formatted text, along with a hyperlink. I’ve also used the new Audio Widget to embed a nice audio player. In the example above I’ve populated it with a .wav file that I’d uploaded, but it could also support files linked by URL. The new Video Widget also gives me a nice inline player, and again can be populated from the media library but also from URLs like in the case above where I have referenced a YouTube link. The last widget I’ve used above is the new Image Widget. Power to the Casual Users All-in, these 3 new widgets, and the updated editing experience of the Text Widget, have given a lot of power to casual WordPress users. For a long time authors and site owners have had to “hack” the plain text widget, and use extra plugins to achieve things as simple as adding rich text to their...

Read More

Adding Widgets to WordPress Pages has Never Been so Easy

By on May 30, 2017 in Plugins | 0 comments

The recent release of v1.1.0 of Widgets on Pages brought in a few fixes, for stability and upgrade paths… but most exciting is the inclusion of the visual editor support in our PRO version. Inserting widgets into posts… …It is as simple as “drags, drops, and clicks” The below video shows just how smart this is, and that an author, with a few simple “drags, drops, and clicks”, can insert widgets inline into their posts, and even align them horizontally. https://youtu.be/w2LfCihCqRI As well as adding widgets and sidebars directly into post content, you can also use the plugin’s template tags to automatically include the sidebars into your theme. This, along with the ability to create as many sidebars as you want – through a familiar WordPress interface – means that this is also a super easy way to add sidebars to your themes. So what are you waiting for, start making your Widgets work for you. Check out Widgets on Pages    ...

Read More

Widgets on Pages v1 Release

By on Apr 29, 2017 in News, Plugins | 0 comments

Well, it was 7 years in the making, but Widgets on Pages has finally made v1 release. Widgets on Pages is the highest rated way to add WordPress widgets and sidebars into both pages and posts, as well as supporting an easy way to add more dynamic sidebars that can be used throughout themes. After some years of very little change I have re-architected the plugin to make use of a more standard Object Oriented structure (based upon the wonderful WordPress Pluign Boilerplate project). This v1 release also moves towards using WordPress custom post types, as storage places for each dynamic sidebar created by the plugin. Although the plugin was untouched for quite some time I did keep an eye on making sure that it was compatible with each WordPress release, and even though I didn’t make any updates it still kept bringing in the 5 star review… so thanks to you all, and the stability of the WordPress internals. It wasn’t all plain sailing As some of you will have seen, the initial bump to version 1.x did indeed land with a bump. I cannot apologise enough. It seems that everyday is a school day… and even though I believed I had thoroughly tested the upgrade from pre v1.X installs I hadn’t. It isn’t a pleasant feeling seeing upgrade issues when you have an active user base of upwards of 70,000 It turns out that my understanding of plugin updates through the WordPress.org repo doesn’t work as I thought it did. I managed to reduce the number of users that were impacted, and, thanks to the effort of users posting to the support forum, I was able to debug what was up and get some quick fixes in and rollback the stable version. I can tell you now that it isn’t a pleasant feeling see upgrade issues when you have an active user base of upwards of 70,000. If you are interested then this article covers how plugin updates are handled. Onwards… onwards The updated structure and use of CPT was put in place to allow an easier route to delivering some more of the items on the roadmap for Widgets on Pages… and I hope that you...

Read More