I am creating an E-Paper kind of functionality in WordPress where the user will have to select a date from the date picker and the corresponding attachment will open. I looked all around but didn't find any suitable plugin or code.

Now, I am aware that the name or some metadata needs to match the date so that it is fetched easily. I just want to know the backend of this process. How should I go about saving the date from date picker and fetch the corresponding attachment (preferably PDF) ?

This type of functionality is used in almost all of publication sites and I want to know if it can be implemented in WordPress.

  • "is used in almost all of publication sites" If this is true then an example would be easy to come by, and might help clarify what you're trying to do. I don't quite understand from the question. – Jacob Peattie Jul 14 '18 at 4:19
  • Take a look here. Here, the newspapers are fetched using a dropdown consisting of cities. How can I do the same thing with date picker? – Divjot Singh Jul 14 '18 at 5:09

I did it! In the end, I used the standard $_REQUEST and $_GET to store and fetch the value in the date-picker instead of all the fancy hooks and filters.

The only thing I am not able to fathom out is the deal with input type-button. It was not storing the value in $_REQUEST. But when I used input type-text, it was all too easy. I don't understand what input type-button is for if it cannot even store a value. If someone can explain it to me, it would be awesome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.