WordPress.org

Ready to get started?Download WordPress

Forums

get_day_link Question (8 posts)

  1. Avenir
    Member
    Posted 9 years ago #

    I have a question about the get_day_link and get_month_link template tags. Is is possible for me to call a link to a year archive using these template tags? Or is there a template tag that would call a year archive for me? I didn't see one on the Codex and the explanations and examples of these two tags didn't provide any information on this either.

    Thanks in advance for any help!

  2. NuclearMoose
    Member
    Posted 9 years ago #

    http://codex.wordpress.org/Template_Tags/get_month_link - Avenir, can you provide some specifics about what kind of information is missing on this page so we can fix it and help you and future visitors with this question?

    Thank you!

  3. Avenir
    Member
    Posted 9 years ago #

    Well, that page and the one for get_day_link don't say if a parameter can be left out without breaking that tags. So, you're saying that I could just use get_month_link without a month parameter and that would just call the link to teh yearly archive?

  4. NuclearMoose
    Member
    Posted 9 years ago #

    Avenir,
    Unfortunately, I can't answer that question. Hopefully one of the coding people will be along to see this and help you out. If you could, I'd love to see you add some suggestions to the DISCUSSION page of the above link I gave you. Anything you suggest which might help someone develop better instructions or examples is appreciated.

    My suggestion, given how I learn how to do stuff, is to try exactly what you suggest and then see if it borks on you! I'm really good at breaking things!

  5. NuclearMoose
    Member
    Posted 9 years ago #

    Avenir,
    Unfortunately, I can't answer that question. Hopefully one of the coding people will be along to see this and help you out. If you could, I'd love to see you add some suggestions to the DISCUSSION page of the above link I gave you. Anything you suggest which might help someone develop better instructions or examples is appreciated.

    My suggestion, given how I learn how to do stuff, is to try exactly what you suggest and then see if it borks on you! I'm really good at breaking things!

  6. Avenir
    Member
    Posted 9 years ago #

    Thanks for your help Moose! I'll post some suggestions on the discussion for that article soon, and I'll try out not using a month parameter in the tag as well.

  7. Avenir
    Member
    Posted 9 years ago #

    Only giving a year parameter to get_month_link doesn't work in the way I wanted. The tag just assumes that the month paramter is the current month and uses that. I did manage to get around that and get the effect that I wanted by just hardcoding the general link to my archives and tacking the year on the end. Not exactly what I was hoping for, but it did work.

    You can check it out on my individual post pages on my site.

  8. Kafkaesqui

    Posted 9 years ago #

    Late to the party, but it turns out there is an undocumented (I'll get on it) get_year_link() tag, which takes (and requires) one parameter--the year, of course.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.