Create your first Widget for WordPress – Intro

As you can see this blog is hosted using WordPress 2.3 engine.
Aside from being free and all, it provides you with easy way to extend it using Widgets.
There is a long list of widgets created by different people over the time and you can find almost anything.
Well… almost… when it comes to personal preference especially a programmer, we might became very picky and I am not an exclusion from this.

I was looking for the widget which will allow me to integrate an ImageBlock from my Photo Gallery into a side bar and I have not find something which will satisfy me all the way.

If you are familiar with Menalto Gallery 2 Engine, then you might know what ImageBlock is a simple preformatted PHP code snippet which you can put in your site’s PHP code to inject HTML showing random (or other kind) of item from your photo collection. In addition you need to include reference to the stylesheet file into the header.
All configuration options are translated into query parameters which are then used by the snippet.
Good, nice, easy… except that WordPress does not allow to use PHP inside your Text Widget, neither there is some very simple widget available around which will allow you do such thing easy way. I am sure there is one but I have not found one up to this moment.

As a result I end up using IFrame for some time with external page embedded. Not very nice solution since IFrame is not to XHTML validator friendly when it comes to transparency and is not auto-sizable without dancing with JavaScript…

After finishing some design work with my blog layout I have decided it is time to create my first Side Bar Widget for WordPress and it happened to be a PHPText.

This entry was posted in Web-design and tagged , , . Bookmark the permalink.

Leave a Reply

  • About

    From a junior developer through Sr Manager position, I was always interested in new technologies. Passionate speaker, IT junky, developer, architect, team lead, and development manager - many hats, one goal - making software better and being closer to people’s needs. For the most part I am using my blog as a scratch pad, writing small articles on things which I came across, was asked about more then once, and which would otherwise require additional research again and again.

    View Serguei Dosyukov's profile on LinkedIn
  • Testimonials

    The greydragon theme is fantastic. It’s clean, stable and feature rich. It took me a while to decide to move...


    I've been using this [theme] since the start. It is by far the most attractive, feature packed and stable of...


    I’m a huge fan of this theme. I’ve got more than 90,000 pictures in my gallery3 running on a Ubuntu...



  • Categories