Get Attachment ID from media_sideload_image()


In this scenario,

The $image variable now returns the full HTML, like this (with single quotes for some reason)

Which isn’t so bad, unless we want to get Just the image URL, or maybe the Thumbnail URL, or just the attachment ID.
Here is how to do it.
Continue reading Get Attachment ID from media_sideload_image()

WordPress archive title display switch

While creating my Blankwork I was looking for different examples of archives pages, since I never used them much. In the end, I was pretty disapointed with all of them.

For example, an else if statement list with opening PHP tags every time, repeating same text and adding comments in between. In my code editor it looked like one big rainbow. An example (which is short and a bit more readable):

I like when everything is clear and easy readable even in code. of course you can dig-through anything, but I made this little snippet just for those, who want a little more clean archives code.

So, I made my own little snippet, which is a bit more Designer friendly, here you go:

BlankWork – The WordPress Blank Framework

When I first started theming WordPress, most difficult thing for me to do was to find something that I could base my work on. I didn’t exactly start everything from scratch. Well – in the end I had to, because I couldn’t find any blank frameworks for WordPress.
While I did find about 10 stripped down templates – most of them didn’t suit my needs. I wanted a simple tiny framework to base my own code on, not tons of code that I have to dig through and then try to fit my work in.
So – I am working on The BlankWork, which is going to offer a basic (tiny tiny) framework to start your theme on. Currently I’m thinking of making the BlankWork in some ways like Initializr, so when downloading you would get some options (whether you want reset css or not, or maybe you want some predefined css styles, or maybe you want threaded comments, etc. ). This is definitely going to be open-source and I hope that with time I will succeed finding some contributors to the development and updating the theme as well.
I am so sure of this, that I already bought the domain –, I can’t wait, I can’t wait.

How to display sub-categories depending on what category you’re in.

Arhh, it took me a while, but I finally figured this out. Decided to share 🙂