For this exercise, please download and install this Duplicator archive package into a new empty database. Then download an underscores starter theme. If we have covered SASS in class, click Advanced Options and choose _sassify! Once you’ve done that, please install the new starter theme into your newly created WordPress site and make sure to activate […]
Category: WordPress Templates
WordPress Theming Links
The Basics To build an understanding of how WordPress themes work, start at the WordPress Theme Handbook, Chapter Two. This will give you a understanding of Template Files Post Types The Template Hierarchy The Loop Template Tags Theme Functions Including CSS & JavaScript Conditional Tags Categories & Tags Template Hierarchy Links The template hierarchy is one […]
Your First WordPress Loop
In your underscores starter theme, create a new file called front-page.php. Into it, copy the following code. You can remove anything that was put there by default by your editing program (if anything). Now go to the front page of your site. What we are going to do is build on this loop in class […]
If you want to know how to install SASS and/or Netbeans on your own computer, consult this document. Set Up Your WordPress Testing Environment Depending on what class we are in, I may give you a Duplicator archive and installer file and get you to install a sample WordPress installation, or I might get you to […]
AUTHORS To display author name as a link to the posts by that author:<?php the_author_posts_link() ?> To display author name, non-linked:<?php the_author(); ?> To GET an AVATAR for your author, sized to 96px by 96px<?php echo get_avatar( get_the_author_meta(’email’), ’96’ ); ?> To GET an AVATAR for your author, wrapped in a link to the AUTHOR […]
About The Loop
The first three lines set up the logic: <?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> Other themes will express this as a single line: <?php if ( have_posts() ) : while ( have_posts()): the_post(); ?> Regardless of these phrasing differences, […]
The WordPress Loop
Without a doubt, the fundamental part of the WordPress system is the loop. The loop is the code that pulls information from your site’s database. In a default WordPress installation, for example, when your front page loads, the loop asks the database the following questions: Do you have any posts to display? If so, can you […]
Many starter themes, or older themes, do not natively support custom menus. In the Appearance > Menus, the top right pane is called Theme Locations. you will be informed there if the theme doesn’t support menus. To add menu support to a theme is a three-step process: Add the menu capability to functions.php Add the […]