Blog: R6D53: #100DaysOfCode (More Posts)
A nice productive start to the new week.
Firstly as I usually do on a Monday, I made a start with updating my photography website, which can be viewed here on my Photography subdomain.
And once that was done, I turned my attention back to building the new projects subdomain, which is coming on nicely.
If you have seen previous versions of the “projects” portfolio site, you might have seen that I tend to divide the content into 3 sets of projects. 1 for client work, 1 for examples of work I’ve done for my own professional development, and 1 for examples of things I have done in the past, I’ve decided to update to try and keep my skills sharp – which I call “legacy projects”.
And I’ve kept up that idea in my new design.
To that end these are the things I’ve accomplished today.
Hooked up the scripts and styles in functions.php
get_template_directory_uri()./ file path. to hook up images/
This is relatively straight forward as you grow more experienced in WordPress development but what was notable in this case was that I found that simply using this line of code
wp_enqueue_style( ‘style’, get_stylesheet_uri() . “/style.css” );
not only enques the styles on the front end but changes the background style of the admin area too. So if you wanted, for whatever reason to have a matching background image or style to that of your website on the front end you can do that.
Setting up the custom post type and grabbing dynamic data from custom fields.
I started setting up the custom post types for my theme. 1 Post type for each type of portfolio piece that I have. Initially, I wanted to simply set up the post types at the back end, concentrate on that and then hook up the content using WordPress loops via calls to the_field(). Instead, I ended up produced a test instance of the client portfolio post type so that as I write this exists on my localhost. And I’m glad I did it this way as it gives me something to build on to replicate this functjonaliy for the other post types.
Making the field types and gettingthe data on screen was easier than I thought as well. I was able to get data for fields of “input boxes, checkboxes, select elements and a text area which wuill be used to display the dynamic data I need for all the portfolio pieces I intend to make.
Most of the time, it’s simply a case of calling the field method and watching the data output to the screen in (hopefully) seamless fashion. But sometimes it takes a little conditional checking to make sure the right styling is applied according to the field values.
Example:
if( get_field( "project_status" ) === "Complete" ): ?> <span class="project_complete"><p> </p></span> </td></tr> <?php else: ?> <span class="project_incomplete"><p> </p></span> </td></tr> <?php endif; ?>
I’m very pleased with the progress I have made so far.


