WordPress.org

Ready to get started?Download WordPress

Forums

Page title from $_GET variables (3 posts)

  1. Echilon
    Member
    Posted 5 years ago #

    I have a navigation menu, and I need to change the ID of the tabs on the menu based on the name of the current page. For example: if the page title is 'Screenshots', run some code to include 'id="activetab"' in the anchor for the page title. Is there any way I can get the title of the page outside the loop? Preferably without a query. I tried var_dump()ing $_GET, but was given an empty array which is odd given that the AskApache RewriteRules viewer shows that page titles should be rewritten to index.php?pagename=$1.

  2. chaoskaizer
    Member
    Posted 5 years ago #

    uses get_query_var($get_var_name) for fetching $_GET request;

    if you want the page title try

    wp_title('',false);
  3. Echilon
    Member
    Posted 5 years ago #

    Thanks. Works perfectly. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags