Skip to main content

Category: Tutorials

WordPress and PHP 5.5

As some of you know the mysql extension is deprecated in PHP 5.5. Most likely it still works but when you want to use it now with WordPress it will fill up your logs. This will get fixed in WordPress 3.7 or maybe 3.8 depending on feature scope for 3.7. There is already a ticket […]

Read More

Cropping Post Thumbnails from Top instead of Center in WordPress

Last week someone I know asked me how to do always a top center crop on thumbnails and I knew it was possible because of WP_Image_Editor. But you always wondered what it was before 3.5 and it always seemed you needed to hack code till I founded a post from George Stephanis. His post shows that […]

Read More

How to load a custom WP_Image_Editor

In our previous post about the class WP_Image_Editor we only talked about some global information. Today this post is going to handle how to load a custom image editor. It isn’t that straight forward you would expected and the reason is that the the code in core is lazy loaded. So when you call wp_get_image_editor() the […]

Read More

WP_Image_Editor

In WordPress 3.5, GD has been abstracted out of core’s image manipulation functions and has been called WP_Image_Editor. Because of that WordPress also has support for Imagick and that is the default choose. It’s giving better image quality to those who have it available on their host. This is particularly important if you’re using images with […]

Read More

Different CSS class for wp_nav_menu in the menu widget

When playing with the awesome theme Responsive I notice the menu in widget was broken because it was styling on the CSS class ‘menu’. Since every menu has this class the widgets also get the main menu styling. You can fix this in the child theme by removing all styling but that seems hard to day. […]

Read More

Using code to register a widget to a sidebar

In almost every theme you see a check if dynamic_sidebar() did returned false then show HTML inside the if statement. See the sidebar.php of Twenty Eleven. Twenty Twelve and Twenty thirteen don’t do this anymore. This is ugly in two ways. The first one is that this kind of logic shouldn’t be in the template files. It […]

Read More

An horizontal sidebar

Last year I was working on a way to get a horizontal sidebar. I worked out a PHP only solution and added a nice selectbox to the widget admin page. Obviously you can just add the amount of sidebar to the widget area and do the magic in your template. I also going to show […]

Read More