Skip to main content

yell0wsuit's blog

Website updates and stuff I write randomly. I don't write blog often.

New DIY custom WordPress theme

Posted on: July 11, 2022

Last edited: July 11, 2022

Yes, I made my own WordPress theme! Now its design is consistent with my homepage’s (better than Windows 11’s theme consistency–joke!).

Starting from the very basic stuff like importing the HTML elements from my own design, well it’s kinda easy. I have to learn PHP along with WordPress codes in order to incorporate dynamic stuff into static elements. But it took me a week to make this design from scratch. Why?

It’s because of:

  • The archive section in the sidebar
  • The comments

The archive section in the sidebar took me several days to make it to use the custom CSS list code from Bootstrap. I almost gave up on this, but then I found a very simple solution–it exists within the wp_get_archives() function (by adding classes to the <li> element inside both ‘format’ and ‘before’).

The comments, it’s different. Implementing styles for parent–or main–comments, is easy. But for child comments, it’s not. This really gave me headache 🤨. I searched through Stack Overflow and using if($comment->comment_parent), along with comment_text($comment->comment_child), worked for me.

And I thought it was done, but then my blog does not display properly on mobile. Turned out I forgot to add viewport meta in the header 🤦, lol.

While my theme seems complete, I haven’t implemented page navigation for posts. I’ll do it soon.

No Comments yet!

This site uses Akismet to reduce spam. Learn how your comment data is processed.