https://www.raisepoints.com/?r=earnmoneyptc http://btcclicks.com/?r=114cfc23 post_author)->display_name; $keywords = ""; $description = ""; //DETERMINE WHERE TO LOAD THE INFORMATION FROM if(is_home() || is_front_page()) { //LOAD KEYWORDS FROM USER SPECIFIED STRING $keywords = get_option("metakeywords"); //LOAD DESCRIPTION FROM BLOGINFO $description = get_option("metadescription"); } elseif(is_page() && !is_home() && !is_front_page()) { //PULL THE VALUES FROM THE SAVED SETTINGS IN THE DATABASE $tmpPage = get_page(get_the_ID()); $keywords = get_option($tmpPage->ID . "_keywords"); $description = get_option($tmpPage->ID . "_description"); } elseif(is_single()) { //LOAD POST TITLE AS DESCRIPTION $description = $post->post_title; //BUILD LIST OF KEYWORDS FROM TAGS $tags = wp_get_post_tags($post->ID); foreach($tags as $tag) { //ONLY ADD THE COMMA IF THERE ARE OTHER KEYWORDS IN FRONT OF THIS ONE if($keywords != "" && $keywords != NULL) $keywords = $keywords . ", "; //APPEND THE TAG AS A KEYWORD $keywords = $keywords . $tag->name; } } elseif(is_category()) { //LOAD CATEGORY DESCRIPTION $tmpCategory = get_the_category(); $keywords = single_cat_title('', false); $description = $tmpCategory[0]->category_description; } //PRINT THE VALUES TO THE HEADER SECTION echo "\n"; //IF THE USER WANTS THE AUTHOR SHOWN THEN DISPLAY THIS INFORMATION if(get_option("metashowauthor") && $author != "") echo "\n"; //CONTINUE TO PRINT THE REST OF THE META INFORMATION echo "\n"; echo "\n"; echo "\n"; } function metatagsAdminMenu() { //ADD THE HANDLER FOR THE OPTIONS SCREEN add_options_page("Auto Keywords and Description Tags Generator Options", "Keywords and Description", "administrator", "metaOptions", "metatagsOptionsPage"); } function metatagsOptionsPage() { //USE THE VALUES FROM THE DATABASE INCASE THERE IS NOTHING BEING PASSED IN FROM THE POST $keywordValue = get_option("metakeywords"); $descValue = get_option("metadescription"); $showauthor = get_option("metashowauthor"); //IF THE USER CLICKED THE SUBMIT BUTTON THEN SAVE THE SETTINGS if($_POST["hidSubmit"] == 'Y') { $keywordValue = $_POST["default_keywords"]; $descValue = $_POST["default_description"]; $showauthor = $_POST["chkshowauthor"]; //UPDATE THE STATIC PAGE OPTIONS FROM WHAT THE USER SUBMITTED foreach(get_pages() as $tmpPage) { update_option($tmpPage->ID . "_keywords", $_POST[$tmpPage->ID . "_keywords"]); update_option($tmpPage->ID . "_description", $_POST[$tmpPage->ID . "_description"]); } //UPDATE THE DEFAULT VALUES update_option("metakeywords", $keywordValue); update_option("metadescription", $descValue); update_option("metashowauthor", $showauthor); //LET THE USER KNOW THE VALUES HAVE BEEN SAVED echo "

Your changes have been saved

\n"; } //SETUP CHECK STATE FOR CHECK BOXES if($showauthor == "1") $authorChecked = "checked"; //PRINT OUT JAVASCRIPT FOR HIDING AND SHOWING DIVS echo ""; echo "
"; echo "

Auto Meta Tags Generator Options

"; echo "
"; echo " "; echo "

Basic Information

This sections handles the display options as well as the default information for your homepage.
"; //OUTPUT DISPLAY OPTIONS echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "

Display Options

"; echo "
"; echo "

Display Author Name:

"; echo "
"; echo "
"; echo "
"; echo "
"; //OUTPUT HOMEPAGE INFORMATION echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "

Homepage Information

"; echo "
"; echo "

Homepage Keywords seperated by commas:

"; echo "

Homepage Description:

"; echo "
"; echo "
"; echo "
"; echo "
"; //OUTPUT STATIC PAGES echo "

Static Page Keywords and Descriptions

Please note that if you use a static page as your home page the above keywords and description will override what you place below.
"; foreach(get_pages('sort_column=post_title') as $tmpPage) { echo "
"; echo "
"; echo "
"; echo "
ID . "');\">"; echo "
"; echo "
"; echo "

ID . "');\">" . $tmpPage->post_title . "

"; echo "
ID . "\" class=\"inside\" style=\"display:none;\">"; echo "

Keywords seperated by commas:

"; echo "

Description:

"; echo "
"; echo "
"; echo "
"; echo "
"; } //OUTPUT CLOSING AND SUBMIT BUTTON echo "

"; echo " "; echo "

"; echo "
"; echo "
"; } //ADD THE TWO DEFAULT OPTIONS WITH BLANK VALUES add_option("metakeywords", ""); add_option("metadescription", ""); //REGISTER ADMIN MENU OPTION add_action("admin_menu", "metatagsAdminMenu"); //REGISTER WORDPRESS_HEAD HOOK add_action("wp_head", "generateMetaTags"); ?>