Categories
How to use the WP_Query function in WordPress

How To Use The WP_Query Function

Knowing how to use the wp_query function can truly take your development skills to the next level. The purpose of the wp_query function is to extend/customize the WordPress loop, giving you very specific queries and producing some very powerful functionality in your websites. It is definitely a more complex piece of code and requires a lot of precise pieces of information but once you learn the basics it is easy to get the hang of using it.

WordPress Custom Taxonomies

Custom Taxonomies In WordPress

Custom taxonomies in WordPress can help you extend the standard ‘Categories’ and ‘Tags’ in your posts. They can also help extend WordPress custom post types if you have created one. Sometimes we run into situations where ‘Categories’ and ‘Tags’ just aren’t enough. Maybe we want to separate things out a little further. That’s what we are going to learn today.

What if you had a project where you were going to apply ‘Categories’ and ‘Tags’ to their posts but also something that would function similarly but called…oh I don’t know…Post Status. Let’s say these posts are being written by many people’s contributions and they need to show that a post is in the creative writing phase or in the proof reading stage. You would be able to harness custom taxonomies in WordPress to accomplish this. Once it has been created, it will show up underneath your ‘Categories’ and ‘Tags’ in the dashboard post menu.

Maybe we need another example. What if your client was a architect. They want to be able to write a blog post about drawing the floor plans and set a category of ‘Drawing Phase’. Then when they begin building the structure, they want to come back into that same blog post and write about the building process. So they would then change the category from ‘Drawing Phase’ over to ‘Building Phase’. Or if they had the taxonomy set as a tag then each phase could be added on as they go. This would require a custom taxonomy called ‘Phase’.

At the end of the article I will explain how to create custom taxonomies in WordPress for the standard post type. For now I will tell you about how to do it with a custom post type because that is where I worked with them in my recent project.

The Problem

In my last article I wrote about creating custom post types in WordPress. I recommend you read that article before reading anymore. In that article I mentioned a client who needed a separate post type to display animals that were up for adoption. They had a few custom taxonomies they needed such as ‘Cat Breeds’, ‘Dog Breeds’, an overall ‘Pet Category’, and a ‘Pet Status’ such as Adopted or In-Active.

Create Custom Post Types in WordPress

WordPress Custom Post Types

This article will teach you how to implement WordPress custom post types. Knowing how to code WordPress custom post types from scratch opens the door to vast possibilities, not only for you as the developer but for your clients as well. WordPress has always been a powerful tool, but with this knowledge you can turn a basic blog website into a massive, multilayer powerhouse.

The Problem

I recently had a client come to us with a WordPress website that used it’s blog as a way to add and display animals that were up for adoption. They then add another WordPress site set up on a separate domain that had blog articles on it. When you clicked to read their blog, you would basically leave the main website and travel to another website. My goal in our redesign and restructuring would be to merge the two together. With WordPress custom post types I was able to do just that.

My vision was to have your regular ‘Posts’ link on the dashboard menu, then below it have a ‘Pet Posts’ link that would harness the same power the posts have but be completely separate from each other. Plus I wanted custom taxonomies instead of using the standard ‘Categories’ and ‘Tags’. This would allow our client to add blog posts and add pets on their main site and not have to log into a completely different dashboard to enter their blogs.

Parallax for WordPress developers

Use Parallax in WordPress

Have you ever wondered how to use Parallax in WordPress? I am going to give you the skinny on how to implement Parallax into any of your future theme developments. After searching all over the internet, I never found a single article that told me the whole process. So I thought, “Wayne your readers need this!” And now here it is.

The Solution

Earlier this week I wrote an article about how to link scripts and stylesheets correctly in WordPress. If you feel like you don’t know how to do this go ahead and read that article because we are going to use that knowledge here in this article.

Linking correctly in WordPress

Link Scripts and Stylesheets Correctly in WordPress

If you are a web developer and build websites using HTML and CSS, you already know how to attach css and js files in the head of your webpage. Well there is a completely different way to link scripts and stylesheets correctly in WordPress. This is what we are going to solve today!

The Solution

Hopefully you already have a good grasp on the page template hierarchy in WordPress, but if you don’t you can learn about it in the WordPress Codex. We need to access the functions.php file because we need to add some code into it to “enqueue” or call the styles and scripts. We will not be adding the below code into the head of our webpage:

WordPress CSS3 Hover Transitions

CSS3 Hover Transitions

In my last two articles I focused on How to use JQuery with WordPress and how to Use the Dollar Sign in WordPress instead of jQuery. These articles gave you jQuery techniques to use with WordPress. Today I am going to show you a super simple, super helpful tool to accomplish some really fancy css3 hover transitions in the websites you build. You won’t believe how simple it is to implement and use!

How To Use CSS3 Hover Transitions

Front-end developer Ian Lunn created a simple css library called hover.css. This file, when either linked to your site in the header or copied into your existing style sheet, automatically gives you the ability to add over 30 different transitions to use on elements in your websites. Once you have the css3 hover transitions linked, choose whichever animation you like best and remember it’s name. Next you add that class name to the element you want to apply it to. In addition, you must always apply the standard “button” class to make the transitions work correctly. Here is an example of the code and how it looks:

Using JQuery in WordPress

How to use JQuery with WordPress

JQuery is a very popular Javascript library that provides simple yet powerful tools to simplify client-side scripting of HTML. It can be an asset to know how to use JQuery with WordPress. For those developers who know it through and through, it can transform a website from being good to being great. Because we all know that a website that is interactive is a website that people stay on longer and re-visit frequently. I will admit that I’m no where near a JQuery master but I have learned enough to use it’s capabilities within WordPress.

Why Would Anyone Need To Know How To Use JQuery With WordPress

Anyone who has every worked on a pre-made theme or who is building a custom theme from scratch knows that there are some things in WordPress that are hard to get to. Whether it be plugins, widgets, or you simply can’t find where the developer put that piece of code. JQuery can help with this! Let’s give you an example. Recently while working on an e-commerce website, I stumbled upon a piece of code that for the life of me I couldn’t find. I really wanted to add the Responsive Columns classes from Twitter Bootstrap onto this specific div. So I leveraged the search and destroy power of JQuery and accomplished my goal.

The Solution

Ok…great for me…now how did I do it so you can do the same thing in your themes. I promise you that the more familiar you get with this wonderful tool the more reasons you are going to find to use it!