WP Media uploader loading only once in options page

The reason for the media uploader not opening when clicking the second button is that both of your buttons have the same ID, which you are also binding to the function that open your uploader. Element IDs should always be unique, hence the .click function listener will only detect when user clicks the first button (=first one with id=”image-url”). To solve this problem, try assigning a common class for both buttons, and bind the media uploader function to that class.

You will run in the same problem upon selecting the image for your BG Image, as both your outer inputs have also same ID (“image-url”), meaning the BG image will be assigned to Logo image. To get around this problem, you could use jQuery tree traversing functions to get the parent of your current input button and call the .val(attachment.url) on that element.

error code: 523