Right! I’m up! It’s three twenty four! In the morning!
Firstly I would like to say that I am now of the belief that my stupid broken mind is a result of alcohol at a very young age. I talk about this stupid broken mind because I’m seeking knowledge from others not because I think I’m special as some would have it. I’ve been through Asperger’s and I’m currently looking at Chronic Fatigue, but I am just of this belief now because I got mashed last Friday and it’s now Thursday and I’m still not fixed. It feels so horrible! But I don’t blame myself for drinking. I can’t. It’s something everybody else does and it’s very difficult for me to cut out forever. Still, I used to have bigger problems with it but now it makes me so ill I physically cannot binge as readily as I used to. So that’s something.
I’ve contacted an online therapist and then gone off the idea. I am so sick and tired of being afraid to live and a lot of it has to do with Brighton and a lot of it probably the state of my mind and nervous system which again is drink related. Sorry. I think people get infuriated “I shouldn’t drink!” say I, and then I do. But if it wasn’t a problem for me, I wouldn’t do it, it’s not like I asked to be a moron.
Talking of technology, I have a website I’m working on. I think it’s largely done but what with not sleeping for god knows what reason it’s gone on for weeks, and the heat making it impossible anyway I’ve decided to look at adding custom fields to this site. Maybe I can do it all before it’s time to get up. How’s that for productive?
Rather than paying for a yearly license of Advanced Custom Fields, since I want to use fields that encapsulate, say, a customer review, which would be an image and some text and whatever else, and the free version doesn’t allow for these so called repeater fields, I have looked for an alternative. I’ve found a thing called Carbon Fields. No idea how it works. Ultimately I have a few different pages in my theme…there is a fucking spider…and I want custom fields for each of them. Maybe less separated by page, I’m not yet sure. No I think page makes sense. Let’s see if I can make them work and document my findings in this document which is entirely inappropriate given how I started this text but I am going slightly mad because…there are fucking two of them…it better leave me alone…I’ve got no blouse on…because of lacking sleep. And spiders, obviously. And if I get nowhere we can all just watch The Office, the US edition because it’s been keeping me company.
Right! The first step is installation. I believe this thing is available from the regular old plugin directory from within the WordPress site so let’s do that. Looks like you can’t! Fantastic. Instead we have to browse to the WordPress root directory using a terminal. There’s then a composer command to install it that looks like this:
composer require htmlburger/carbon-fields-plugin.
Except I can’t run that because I don’t have fucking composer. How I get composer? If I don’t have composer, how the fuck did I use it with Laravel? Eh? Oh I’ve found a piss easy way. You can just download the plugin and plonk it into your plugins directory. I’ll do that. Saves me showing my ignorance. I mean I know what it does, this composer thing, it’s the NPM for backend persons, but I only vaguely remember installing it once during a job. Maybe Laravel looks after that with magic. Or maybe you have to do a global install with it like you can NPM, but this will do. This is called improvising you utter fools…I wish that spider would fuck off.
Now I’ve add the directory to my plugins folder. It now says to add the following to the top of my functions.php file.
This spider. It comes all the way down, lands on the mouse wire and then shoots back up to the ceiling. It’s coming down again. I think it might be quite playful. I think I shall get my bug catcher; it’s rather off putting. We may end up with two in the same catcher, they’ll just have to battle it out.
So, if I add the above, apparently I should see a new Theme Options admin section with a text field. No idea how to use the input or if it’ll save as it is but I’m going to plonk that text into my functions.php and let you know. I wish I could write like this in a professional blog without damaging my chances of employment. The fact is old fucking neighbour from Brighton I have to live my life. You utter disgrace of a human being.
With that code added…did it work. That’s my question. No. Of course the answer’s no. Aha! I had to active the plugin! Of course. Didn’t tell me that in the documentation did you Carbon man. Probably thought I’d not be so stupid, but always remember that some of us are. Look at politics in this country. Look at who might next be our prime minister!
Right, what’s next. Well here’s a screen shot of what I’ve got so far:
That’s what I see if I click on Theme Options from the sidebar. Now I need a way to separate all this shit into different pages. Starting with Home.
You can create a thing called a Container. But I’m a bit confused as to the practical implications of what one actually is. “A Container is a group of custom fields and display options.” What the fuck is a display option? “Containers are displayed on different parts of the backend, according to their type and display options.” What the fuck is a display option and my WordPress is probably not good enough to understand type either. They have set options for type; post_meta, term_meta, user_meta, comment_meta, nav_menu_item and theme_options. I feel like maybe I will only need one container of type theme_options? Let’s try this shit. Ah! Looks like I’m already making one. I don’t really want more than one option in the sidebar so let’s leave it as it is and see if we can segment things for each page. What else does this thing say?
It says we can make tabs like this:
Okay, I’ll try and make a Home tab based on the above. Well I’ll be…
I’ve added a Profile tab. I’ll need ten tabs though. Can it cope? And why do these spiders always start lowering themselves where you’re sat?
It works. Looks a bit gash all wrapped like that but on the other hand it’s a good way to handle smaller screens. It’s that or arrows, right Windows?
I think I’ll add a general tab in there as well. I want something for the email to send to when someone gets in touch, somewhere to store the phone number, possibly the address as I want to fix up the footer a bit more to include it, that kind of thing. I bet Johnny Depp’s life’s more interesting than this. How could I have got Brighton so wrong? Was it all in my head? I have emailed the estate agent to see if they’d heard anything and I’ve emailed the LGTB liason officer of the time, a very, very kind man. He thought it was my mental elf. The problem is that this is going to keep sticking in my head for more years to come if I can’t sort it.
Let’s start with the home page. I kind of feel like I’m going to want to iterate over the names of things. Maybe that’s not practical in the case of listing out the pages in the footer. So let’s have:
- A page title
- A bio title
- A bio bit of text, multiline if they’re distinguishable
- What can I provide? title
- What can I provide text. I hope you can style the text in these things, some of this is bold.
- What can I provide image
- Working with you as an individual title
- Working with you as an individual text
- Working with you as an individual image
- Workshops title
- Workshops text
- Workshops image
- Testimonials — these will be complex fields because they contain; image, text and author and date where author and date can be a single field. There will be two lists for this; business and individual.
That’s it for this page I think. It doesn’t need an image because it just uses all the images from the other pages. In fact it doesn’t even need the home page so I’ll strike that through right this fucking minute. Did you ever watch Grace and Frankie? I am tired of being me. Llllet’s get cracking!
I take it back. I take it all back; we do need a page title since it’ll show in the footer if nowhere else. Okay let’s keep it. For me to “action this” because I fancy talking like an idiot in an office, I think all I need to do is give it a decent internal name and a label of Page Title for the UI and then it’s done. Done as a bastard.
What’s next? A bio title. Piece of piss coz it’s the same. Just a title.
Now some text. I wonder what text options there are. Looks like there’s text, textarea and rich text. I’m inclined to go for rich text for now as maybe my client will want to make stuff bold in the future without knowing HTML. As a caring human bean, let’s try that. Well from an editor perspective it looks pretty good. Will just have to see how good or crap or easy it is to use when we get the output out of it.
Gah! I forgot to include a bio image. I wonder how that works. Nice! I’ll show it at the end but it allows you to select an image to use. Makes sense to me.
Next up is the “What can I provide?” title. Done. What can I provide text…rich text again…and a what can I provide image. That’s another section done.
Hey listen, listen, it might be 04:36 but I really fancy scrambled eggs. I’d be so much happier and normal and bouncy without Brighton in my ears.
I am going to fetch an ice lolly, but next is a “Working with you as an individual” title, content and image. Done! Even before I ate some lolly.
Okay before I watch some office I need; workshops title, workshops content and workshops image. Then all that’s left is the testimonials stuff. For now at least. Testimonials might be tough.
Okay how do I do testimonials. Ideally I want to construct a field type with an image, some text and author/date text. Then be able to have a two lists of this type. How do we do this? Bloody hell that was easy. I’ll tweak the code and then show you what it looks like but this really was piss easy to do and all without Advanced Custom Fields! Thank you htmlBurger!
That was it! You create a complex field, add your sub fields crb_slider is wrong, I’ll change that, but then it will allow you to add multiples of this group. Copying this and renaming stuff for business testimonials will be easy.
I think that’s it for the home page. Obviously I now have to get the data into the site from the Home page tab but I don’t think that’s too bad for a morning’s work. For now anyway. I expect I’ll actually pass out shortly. I’ll try to incorportatetatatato the fields tomorrow morning. That’s quite enough for now. I might continue this later. Maybe I’ll do the other pages, they should be quicker to do anyway as the home page was more complicated than some. I think. It’s a shame isn’t it, how we get old and die? Like…I’ve spent the last six years upset, confused and lost, and then all the while, our one time shot is burning away like a candle. I don’t want to waste time. But I also feel like I need to know…