From the course: WordPress: Building Progressive Themes with WP Rig
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Add a custom image size - WordPress Tutorial
From the course: WordPress: Building Progressive Themes with WP Rig
Add a custom image size
- [Instructor] Now that our component works, and we have our Java script enqueued, we can start customizing the functionality of this particular component to make it work exactly the way we want to. In between the previous movie on this one, I've added some small things to a couple of files so in component.php, if you scroll all the way to the bottom, you'll see I've extended display_related_posts to output not only the headline but also this aside with a class related-posts and alignfull, and inside that aside we have a div with the class related-spinner. So this creates the container that the related post will sit in, and then we have a spinner that will be displayed for as long as the REST process is running, until we get the result, and then the spinner goes away. related.js also has some slight modifications. I've built out the entire function now, so looking at the script you'll see it's a lot longer than it used to be. Just for reference, all the logic behind this and how this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.