Changing the meta tags on the Q&A plugin

How would you suggest adding meta tags such as title and description to the archives page. Right now, the title defaults to the last question asked, but it would be great to have the seo and SERP of this page stronger so I can try and rank for the appropriate keywords.

Thanks in advance

  • scribu
    • Site Builder, Child of Zeus

    If you're adding the title in your theme's header.php, you could do something like this:

    <title><?php
    if ( is_qa_page( 'archive' ) ) {
      echo 'The title for the questions page';
    } elseif ( is_home() ) {
      echo 'The title for the home page';
    } ... etc.
    ?></title>

    The same for the meta description.

    Other possible values that is_qa_page() accepts:

    'ask'
    'unanswered'
    'edit'
    'user'
    'single'
    'archive'
    'tag'
    'category'

    Writing if ( is_qa_page() ) without arguments returns true for any question page.

  • jeffreygaudette
    • New Recruit

    First, thanks for the notes on the conditionals. This is very helpful!

    The problem with the header title is that it still displays the last asked question before my newly defined title. So, the title looks like this: "last question asked | "my custom title in the meta". Any idea on how to get rid of this first part?

    Thanks for the help on the conditionals.

    Jeff

  • scribu
    • Site Builder, Child of Zeus

    That's rather strange. When I go to /questions/ the title is Questions | My site title.

    Try switching to the twentyten theme to see if the problem persists. If that doesn't help, try deactivating other plugins until it goes away.

    If the trouble is in your theme, paste the code block you're using for displaying the title.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.