WordPress.org

Ready to get started?Download WordPress

Forums

wp_get_archives inside head -- why? (4 posts)

  1. whooami
    Member
    Posted 7 years ago #

    I'm cleaning house on my site, literally, and have a question about something I've always done, but don't understand why.

    This:

    <?php wp_get_archives('type=monthly&format=link'); ?>

    within the <head> tags..

    I see what it outputs but dont understand the value.

    Why do we do it?

    I notice that it's still being used in 2.2 inside kubrick also, so I'm missing something or it's a holdover from something else that's never gone away.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    This outputs the link tags inside the header.

    The purpose of link tags is to specify links that related to the current page. The rel attribute specifies how these links are related.

    Some examples:
    <link rel="stylesheet" href="whatever.css" type="text/css" media="screen" />
    This specifies where the stylesheet for the page is, when you're displaying it on the screen. If the media said "print", then it would be a stylesheet that would be used when the page was printed.

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="whatever" />
    This gives an alternate version of the page. In this case, it gives the RSS2 feed for the page.

    <link rel="pingback" href="http://example.com/blog/xmlrpc.php" />
    This gives the pingback address, for automatic pingback functionality.

    <link rel='archives' title='May 2007' href='whatever' />
    And finally, this one tells where archived versions of this page can be found.

    Some link tags are used by the browser, some are used by search engines or other tools. But *all* link tags are not meant to be directly seen by the end user, they're a form of metadata about the webpage itself, specifying other related webpages. They are used exclusively by browsers, search engines, and other automatic tools.

    More info:
    http://wordpress.org/support/topic/115211

  3. whooami
    Member
    Posted 7 years ago #

    thanks for explaining that, I spose - though it was more than I asked about .. I understand what the other stuff is for, and I know what it outputs.

    I am, however, still in the fog, about what, specifically, those particular links are for, tool-wise.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    It is known that some search engines use that information. Google, in particular, will follow those links to find new pages to index.

    That is the only current known use that I can find anything about.

Topic Closed

This topic has been closed to new replies.

About this Topic