What kind of glue to make a magnet adhere to wood?
Magnets are notoriously glue-resistant.

There are sticky soft magnets used e.g. for refrigerator magnets, which would kinda work on the glue front, but they are pathetically weak.

You could try two-ingredient epoxy for other magnets; it tends to stick really well to pretty much everything and if it won't, you can practically encase anything with it.

But I believe the best solution would be to forgo the glues and obtain some tiny neodymium magnets with a hole:



These are very strong, so even a tiny one can support your heart, and they can be affixed to a surface with a nail or a screw, making a very strong connection.