version -->\n"; // keywords are always generated from the posts' keywords $keywords = $this->get_all_keywords(); if (is_single() || is_page()) { // the easiest part: a single post or page $description = trim(stripslashes(get_post_meta($post->ID, "description", true))); } else if (is_category()) { // here we can at least use the category description $category = get_the_category(); if (isset($category[0]->category_description)) { $description = trim(stripslashes($category[0]->category_description)); } } else if (is_home()){ // index page if (get_option('another_wordpress_meta_plugin_home_description')) { $description = stripslashes(get_option('another_wordpress_meta_plugin_home_description')); } else { $description = get_bloginfo('description'); } } if (isset ($description) && !empty($description)) { $meta_string = sprintf("", $description); } if (isset ($keywords) && !empty($keywords)) { if (isset ($meta_string) && !empty($meta_string)) { $meta_string .= "\n"; } $meta_string .= sprintf("\n", $keywords); } if ($meta_string != null) { echo $meta_string; echo "\n"; } else { echo "\n"; } } function get_all_keywords() { global $posts; if (is_array($posts)) { foreach ($posts as $post) { if ($post) { if (get_option('another_wordpress_meta_plugin_use_categories')) { $categories = get_the_category($post->ID); foreach ($categories as $category) { if (isset($keywords) && !empty($keywords)) { $keywords .= ','; } $keywords .= $category->cat_name; } } $keywords_a = $keywords_i = null; $description_a = $description_i = null; $id = $post->ID; $keywords_i = stripslashes(get_post_meta($post->ID, "keywords", true)); if (isset($keywords_i) && !empty($keywords_i)) { if (isset($keywords) && !empty($keywords)) { $keywords .= ','; } $keywords .= $keywords_i; } } } } return $this->get_unique_keywords($keywords); } function get_unique_keywords($keywords) { $keywords_ar = array_unique(explode(',', $keywords)); return implode(',', $keywords_ar); } function admin_menu() { add_submenu_page('options-general.php', __('Another Wordpress Meta Plugin'), __('Another Wordpress Meta Plugin'), 5, basename(dirname(__FILE__)), array($this, 'plugin_menu')); } function add_meta_tags_textinput() { global $post; $keywords = stripslashes(get_post_meta($post->ID, 'keywords', true)); $description = stripslashes(get_post_meta($post->ID, 'description', true)); ?>
Meta Information (by Another Wordpress Meta Plugin)
ID, "keywords", true)); if ($keywords) { $tags = ''; $count = 0; $a_keywords = split(",", $keywords); foreach ($a_keywords as $tag) { if ($count++) { $tags .= " "; } $tag = trim($tag); $url = $base_url . $awmp_tag_url; $url = str_replace('$tag', $tag, $url); $tags .= "$tag"; } $content .= "
$tags
"; } } return $content; } function plugin_menu() { $message = null; $message_updated = __("Options for Another Wordpress Meta Tags Plugin Updated."); // update options if ($_POST['action'] && $_POST['action'] == 'update') { $message = $message_updated; update_option('another_wordpress_meta_plugin_home_description', $_POST['home_description']); update_option('another_wordpress_meta_plugin_tags_base', $_POST['tags_base']); update_option('another_wordpress_meta_plugin_home_keywords', $_POST['home_keywords']); if ($_POST['generate_tags']) { update_option('another_wordpress_meta_plugin_generate_tags', true); } else { update_option('another_wordpress_meta_plugin_generate_tags', false); } if ($_POST['use_keywords']) { update_option('another_wordpress_meta_plugin_use_categories', true); } else { update_option('another_wordpress_meta_plugin_use_categories', false); } wp_cache_flush(); } ?>

here. ') ?>

All In One SEO pack for even easier Search Engine Optimization.'); ?>

main page / home page:') ?>

/>
/>
($tag will be replaced by the tag)
NOTE: Only change this if you know what you\'re doing!')?>