In the template-parts folder, duplicate content-staff-member.php and name the copy content-meal-menu.php. Here’s the contents of the new file: Change that code in the following way: change two classes change two fields remove the post-thumbnail div add the content area Now edit front-page.php Duplicate the Staff Members Section and change the following things: section class to […]
Category: WordPress Templates
Another Custom Post Type: Meal Menus Go to the CPT UI part of the Dashboard and choose Add / Edit Post Types. For the slug, use meal_menu. Fill in the Plural and Singular labels (with Meal Menus and Meal Menu, respectively) and then click the Populate additional labels based on chosen labels link. In those […]
A New Staff Member In the Staff Members section of the Dashboard Sidebar, click Add New. You can also do this from the New menu in the Admin toolbar. You will then see this screen. It looks like a traditional post, sort of, but not… For the first employee use these values: Title: Doris Shutt […]
Theory: Custom Post Types WordPress has two main kinds of content: posts and pages. Posts are organized with tags and categories. They typically have titles, content, excerpts, feature images, etc. However, much content doesn’t really “fit” that method of organizing. Fortunately, it is possible to create other kinds of post types through a feature called […]
About Custom Loops This will be one of the more complex topic we cover in this class, but knowing how to make multiple loops in a single template file gives you some amazing abilities. The default loop gives you posts in order of most recent to least recent. However, with custom loops, we can select from […]
Icon Fonts with WP_Nav_Menu()
HIDING THE LINK TEXT:With wp_nav_menu, you can specify content to go before and after each link in the menu. Here “link_before” and “link_after” are being used to wrap the link text in a span that hides it while still remaining accessible. INSERTING THE ICONS:Then we can use CSS BEFORE pseudo-class selectors in order to inject […]
Enqueuing for Scripts Enqueueing scripts (or local stylesheets), it is a bit more complicated, but it’s learnable. Underneath the last wp_enqueue_style function, type wp_enqueue and select wp_enqueue_script from the menu that shows up (thank you, WordPress Snippets extension). The following helpful boilerplate is output, showing us what arguments are expected by the function: The values […]
The verb to enqueue comes from the French language. It means to put something into a lineup. In WordPress the wp_enqueue_style() and wp_enqueue_script() functions are used to manage the loading of external resources like scripts and stylesheets. Why do we do things this way? Imagine if you have a theme that requires a dependency (some […]
For this exercise, please download and install this Duplicator archive package into a new empty database. Installed with this package is a plugin called Show Current Template. That will add information on the ADMIN bar when you’re logged in and viewing pages in the browser, showing what template files are involved in the creation of the […]
Introduction to the Functions File A very important file in any WordPress theme is functions.php. In it, we typically do things like the following: enable theme feature support, like feature images, custom logos, block editor styles, etc enable certain gutenberg block features such as wide alignment or full alignment, etc notify (register) WordPress about how many […]