Chunks of Useful Code

Posts Tagged "Widgets"

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

Enhancing a WordPress Site without Code

By on Jul 13, 2017 in News | 0 comments

TwentySeventeen has been a hugely successful and adopted theme for WordPress blogs and sites. And that certainly has to do with it’s customiser options, including the ability to set static homepage areas. In doing so, you can unwittingly remove some very useful features from your users. For example on my personal blog I have set a static homepage up, that has the “2 column” width, with recent blog posts being listed underneath. Whilst I really like this layout, it does means that I have lost the standard sidebar, and along with it some useful widgets, such as a search option. In the video below I demonstrate how I can re-add these features in, using Widgets on Pages. I also show how I can use the new “Auto Insert” feature of the Pro version to include certain widgets at the end of each blog post.   Video Transcript In this video we’re going to enhance our 2017 themed WordPress blog, with a few widgets and plugins… with a secondary aim of not having to touch any code. This will give our site extra functionality, useful to the user, but also provides hooks to try and increase the time the user spends on our site. I’ll be using my own site as a demo, and you can see a quick demo here. I have used the customizer to set a static front page, and then also used the next content part to list my recent blog posts. Since I have done this I’ve lost my sidebar, but I want to include some functionality that sidebars give me, namely widgets. Functionality I’d like includes “search“ and maybe a link to a featured / stick post. Another feature I’d like to add is some hooks at the end of each blog post to try to engage with the user, in my case I’m wanting to add “featured / sticky posts” links. For me to achieve what I want, without having to code anything, I’m going to add a couple of plugins to my site. Firstly a “posts-in-sidebar” which will enable us to create widgets for our sticky posts. This is a 5 star plugin with a 10 active installs… though it does not...

Read More

Widgets on Pages v1.2 – Auto Add Widgets to Posts

By on Jul 12, 2017 in News | 0 comments

That’s right folks. v1.2 of Widgets on Pages Pro is here, with the shiny new addition of being able to select “Auto Insert” options for Turbo Sidebars, to automatically add sidebars and widgets to posts and pages. The plugin enables you to append widgets to WordPress posts and pages, with the option to either have the widgets displayed before, or after, the post or page content. You can specify whether the widgets should automatically be inserted into Posts, Pages, or both, and a new meta-box appears on the individual post/page editing screen to allow you to disable the auto-inclusion on a per content basis. This new feature is perfect for adding hooks into your site, for your users. Examples include adding a “recent post” listing to the base of posts, adding a newsletter sign-up to the end of pages, or even adding a notice box to the top of all content highlighting some important temporary information (e.g. Emergency closing hours of your shop, or a security update for your online...

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 Widget 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