Custom Headers in WordPress Themes

Add Custom Header Support to your WordPress Themes To enable Custom Headers in your wordpress themes, add the following to your functions.php file: When enabling Custom Headers, you can configure several other options by passing along arguments to the add_theme_support() function. You can pass specific configuration options to the add_theme_support function using an array: In the above case, the default array values are assigned to a variable called $defaults. Set a custom header image When the user first installs your theme,...

Page Templates in WordPress Themes

Page templates are a specific type of template file that can be applied to a specific page or groups of pages. Since a page template is a specific type of template file, here are some distinguishing features of page templates: Page templates only apply to pages, not to any other content type (like posts and custom post types). Page templates are used to change the look and feel of a page. A page template can be applied to a single page,...

Template Hierarchy in WordPress Themes

This article explains how WordPress Themes determines which template file(s) to use on individual pages. If you want to customize an existing WordPress theme it will help you decide which template file needs to be edited. The Template File Hierarchy Overview WordPress Themes uses the query string to decide which template or set of templates should be used to display the page. The query string is information that is contained in the link to each part of your website....

Custom Archive Page for Your WordPress Themes

Why We Need the Archive Page In WordPress Themes, you get to work with a range of different page templates and structures in the standard configuration. Looking at the directory listing of the default theme at the time of writing, Twenty Fifteen, we find the following: 404 error page, archive page image attachments page, index page (the main page), default page template (for pages), search results page, single post and attachment pages. Despite their different purposes, all of these pages are...

Basic Knowledge of Hooks in Your WordPress Themes

All in one word, hooks are built into WordPress or wordpress themes and are used to modify or add functionality to the core system without modifying core WordPress files at all. The Requirement of Hooks Let’s assume for a moment that WordPress does not provide any hooks. And let’s also say you work with a lot of scheduled posts and you would like to email yourself when a post is published. How would you go about doing that? Without hooks you...

Basis for WordPress Themes Plugin Development

A plugin is a safe way to try out new things and the way to go if you need to implement cross-theme functions. This article will walk you through creating a simple plugin to have a look at some basic concepts about wordpress themes plugin. A Simple Plugin Project In this article we’re going to create a plugin that integrates WordPress and Facebook Open Graph. Open Graph tags are special HTML tags, which give Facebook the information it needs to share your page and...

Create Shortcodes for Your WordPress Themes

Creating shortcodes for use in wordpress themes is fairly straightforward. Shortcodes are written by providing a handler function. Shortcode handlers are broadly similar to WordPress filters: they accept parameters (attributes) and return a result (the shortcode output). Shortcode names should be all lowercase and use all letters, but numbers and underscores should work fine too. Be wary of using hyphens (dashes), you’ll be better off not using them. The add_shortcode function is used to register a shortcode handler. It...

Custom WordPress Themes Menus in Wp Admin

If you have a theme that supports the Custom Menus feature, you can create and arrange a group of navigation links for your visitors to find the important parts of your site faster. Most Custom Menus will show in the header area at the top of your site (the main navigation area), though this location can vary from theme to theme. With some themes, you may have the option to create and display multiple custom menus in different places...

Design Basic WordPress Themes Header

By default, the WordPress header is a simple piece of code. You do not have to get into the code to change the header that comes with whatever WordPress Theme you choose. You set the blog or website title and description in the Administration > Settings > General panel, and WordPress does the rest. In its simplest form, the WordPress Classic Theme features the header code like this in the wp-content/themes/classic/header.php template file: The header is set in an...

3 Ways to Create a Page Template

What Is A Page Template? A page template gives you the ability to deviate from your site’s existing structure in addition to adding new features. Twenty Fourteen includes two great examples: a contributor page and a fullwidth page. The contributor page introduces new functionality: the ability to list the authors who have contributed to your website. The full width template alters the structure of the page by removing the sidebar, focusing more on content. Twenty Eleven also provides two page...