WordPress: Download failed. A valid URL was not provided.

Some days ago I’ve updated my WordPress to the new 3.8 version.
For storing my themes and plugins I’ve set up a repository on a virtual machine running on the same virtual network.

This was working perfectly until WordPress 3.5, but since 3.6 the developers added a new security feature that denies access to repository with a local ip, for example 172.[16-31].x.x as in my case, but also, 10.x.x.x, 192.168.x.x.
Continue reading →

WordPress multisite: My Sites menu in the admin bar shows the same blog after updating to 3.5.1

Today I’ve noticed a little bug come out on my WordPress network running on a WordPress Multisite configuration.
In the admin bar the My Sites menu was showing the currently viewing blog a number of times.
Further looking revealed me that for every blog on the network that link was pointing to the current blog.

My first thought was ‘something went wrong in while updating WordPress to 3.5.1‘.
But I was wrong.
Continue reading →

How to replace Sendmail with Gmail smtp on Ubuntu server

Today my goal was to be able to send mails from PHP from my web-server using Gmail smtp.

  1. My server runs on Apache with vhosts: I need a separate mailbox for every domain.
  2. I don’ want to manage a MTA because it’s resource and time expensive, so I want to send mails trough a Gmail account.
  3. I want the system to be fast and easy to maintain.

The standard packages such as postfix, sendmail, qmail etc doesn’t meet the last two requirements, so I had to choose an alternative to postfix: MSMTP

Continue reading →

Eclipse: WordPress Code Completion

WordPress is one of the most known and used CMS in the web.
Eclipse is one of the most know and used IDE in the web.
Why they shouldn’t love each other???
The answer is simply: they do… if you edit 2 files.

Code Completion is one of the absolutely needed feature for an Integrated Development Environment such as Eclipse.
Eclipse, born for Java developing, nowadays support almost every open language with the help of an huge number of plugins.
PHP is included in this list. There is a ready to use suite codenamed PDT (PHP Developing Tools) and tons of how-to install it.

Continue reading →

Bootstrap Navbar under WordPress

If you’re fallen in love with Twitter Bootstrap and WordPress as I am, you’ll probably need to develop a theme with both of them and one of the first issue you will find is to have the navbar integrated with the wordpress menu managing system.

There was a nice and candy walker, written by johnmegahan that makes the hard job done in like 2 minutes of googleing 🙂
Thank you John!

The limit was that it only support a double level menu. This means you can only make a dropdown, wich in BootStrap is not an anchor to a real page but only a toggler element for the openclose popup, with a list of one level.

Continue reading →

WordPress: breadcrumbs for custom taxonomies with Yoast’s SEO

WordPress SEO is a very good plugin developed by Yoast.
It has a ton of interesting features including a nice and easy to use ‘Breadcrumb‘.

It works like a charm until you have to integrate a custom taxonomy in a page:
for example I had to insert a Portfolio section managed by BWS Porfolio Pugin in normal page.

In my case (this site, portfolio section) i have a custom taxonomy for the portfolio in witch every post is a project I’ve developed.
Then the page ‘Portfolio’ retrieves the last entries and prints it like a normal blog homepage.
This is managed by BWS Portfolio plugin.

Continue reading →

Slideshow in WordPress

If you’re planning to build a showcase website with WordPress you’d probably insert at least in the home page some images with a sliding effect.
By using jQuery make them slide is pretty easy, but I had some trouble to choose a way to manage the images in the cms.
My goal was to use the fewest number of plugins possible, because i want something usable on most of website I have to develop.

WordPress put at our disposal a gallery tool which is reachable by clicking on the “Add Media” button on top of the body article.

By using this we have a big pro: WordPress takes care of re-sizing and cropping the images.
The con is that by default this system will show only a list of thumbnails linking to the fullsized image.

Continue reading →

Slideshow: one big image for all

Most of website I’ve set up weight is given by the images of the slideshow.

Here’s a simple PHP function that can be usefull to reduce both weight and number of connection for this element.

The concept behind this function is pretty simple:

  1. take an array of images (jpg/png/gif)
  2. merge them in a unique big jpeg image
  3. return the url to this one.
  4. using css sprite tecnique, set this big image as the background of every <div> of the slideshow with a different background-position.

Continue reading →