Heres what we started with. Just a salvaged piece of wood from my FIL's farm.
Roughed it up by hand with a sander
Measured and chopped to size
Found and marked our "Studs" aka wood boards that run vertically in your walls, usually around every 16".
Then Drilled a hole in both. Then placed a larger bit on the drill and drilled again, until reaching the size of the "lag bolts" we screwed into the wall that hold up the shelf.
We then got the longest lag bolts we could find, 6", and chopped the head of the bolt off with a grinder. Install into the stud with a pair of pliers or vise-grips. Try to get the bolts as level and straight as you can to make sliding the shelf on as easy as possible.
Measure your lag bolts spacing then drill into your wood where needed.
Vwallah! I love it. Perfect for coffee cups! No too much work either.
My kitchen is nothing special now but it's mine so I love it. Just ordered a new faucet yesterday though!