Sometimes in WordPress when you want to query a particular page but don’t know it’s ID and know better than to rely on it’s title there is no way to really query it. For example if you had a contact page that used a custom template called, “contact-page-template.php” there is no internal function that does this for you.
WordPress stores the page template into a private custom field on each page that has a custom template assigned. Using meta queries, we can query pages by this custom value. The following function will allow you to query a page by it’s template and either return or echo an array of contents as well as support for a single key (you only want the title or url for example).
You can edit any page imaginable in WordPress, except the 404 error page. Usually the 404 error page is only editable by opening up the 404.php file in your WordPress theme directory and changing the content that way. There are plugins which allow you to have custom 404 pages, but there is no point in using plugins if you can do it easily yourself.
Wouldn’t it just be simpler if you could edit your 404 page from within the pages menu in the WordPress dashboard? Well, you can.
As you may already be aware of, iOS devices (iPhone, iPad and iPod) do not support the hover event. While this isn’t usually a problem, when it comes to dropdown navigation menus it is a problem because as you’ll discover unless your parent hyperlink doesn’t link anywhere, a user will click a navigation item and be taken to that links location. An example of the scenario is shown below for the visual people.
Whilst recently working on a WordPress theme I needed a way to apply gradients to elements via Javascript without having to write 5 separate lines for supporting the multitude of various browser prefixes for varied support so I wrote a plugin after Googling and not finding anything similar. The plugin is called Gradientizer and can be found on Github here.
The plugin is very simple, you can have multiple colours (simply specify the percentage value and colour) and optionally your gradient direction (vertical or horizontal). That’s all there is to it. If you look at the Github repo above you’ll also see a simple example in the README and description showing you how to use it.
There is no denying that the WordPress Theme Customisation API is an awesome addition (added in version 3.4) however there are some things that it can’t do out of the box and if you’re not a super developer capable of creating your own customize classes to create custom sections and settings with textual descriptions then you’re fresh out of luck.
The Theme Customisation API has support for a description attribute you can add to your sections like so:
Chances are if you’re developing a responsive website and using a Google map you will encounter an issue where the zoom control and street view control appear to be broken, they’re there but not clickable and look corrupted. The issue is the usual process of developing a responsive site entails of setting max-width: 100% to all images on the site in the form of the following:
img { max-width: 100%; } This will also break your Google Map controls. The simple fix is to fix the max-width property by targeting your map container with the following CSS:
The saying you get what you pay for rings true. Recently while working with a really nice client (just one lady running her own unique business) I came across Bluehost.
She had a hosting account with Bluehost, the “Platinum Pak” when a hosting company deliberately misspells the word pack like a teenage girl texting her friends, it does ring some alarm bells. But having had nothing but a great experience with their rival Hostgator (I used them for years before my needs went beyond it) I reserved my judgement until I tried to get support.
Recently while developing a site for a friend they wanted Facebook comments instead of the regular WordPress comments. Integrating was very easy, however when it came to making the site responsive the Facebook comments box which is an iframe didn’t want to play along and instead was being cut off.
After trying numerous solutions online (all which seemed to be out of date) I eventually got it to work using the below code. Hopefully this helps you out as well.
in all my years being a web developer I’ve never noticed Firefox has an annoying problem with file input fields and the size attribute. For you see if you have a file input field in a form with the size attribute specifying the number of characters in width the input is, you’ll notice setting the width via CSS is completely ignored regardless of whether or not you use an important declaration.
We can all rest easy now that Google Maps have landed in the Apple app store to much fanfare. While the hate directed towards Apple’s bundled iOS maps was blown out of proportion, Google’s new shiny maps app which features turn-by-turn voice directions, a slick smooth interface and vector maps shows that Apple really did drop the ball when it came to their own map application.
The release of Google Maps for iOS came out of nowhere. Google have been rather ambiguous about their plans to release Google Maps for iOS to the point where people questioned whether or not Google would even release a standalone app for iOS.