Holy Smokes That Was Tough!
Okay so a page back you can see (with help from rainthebat) we have the problem with the manufacturers and other filters fixed.
Now to add CUSTOM METAS per post, category, page. . .
FOR ZC 1.3.8A & WP 2.7.1 with ZC & WP installed in the root (public_html) together. Running with the .htaccess mod and permalinks set to custom /%postname%/.
If you're running a blog(wp) you need to SEO it anyways so do these things. Add something like this to your .htaccess file.
Code:
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^BLOGNAMEHERE/ index\.php?main_page=wordpress&%{QUERY_STRING} [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Create 3 files as follows:
Create a folder inside of includes/templates/template_default/ Called wordpress. In this folder upload a copy of html_header.php from your templates common directory. Replace
PHP Code:
require(DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'));
with
PHP Code:
require(DIR_WS_MODULES . zen_get_module_directory('wp_meta_tags.php'));
Next: Save the following code as " wp_meta_tags.php " and upload it to includes/modules
PHP Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// This should be first line of the script:
require(DIR_WS_LANGUAGES . 'english/12volt/wp_meta_tags.php');
function curPageURL() {
$pageURL = $_SERVER["REQUEST_URI"];
return $pageURL;
}
$wpPageBase = curPageURL();
echo strtoupper($wpPageBase);
// if per-page metatags overrides have been defined, use those, otherwise use usual defaults:
if (defined('META_TAG_TITLE_' . strtoupper($wpPageBase))) define('META_TAG_TITLE', constant('META_TAG_TITLE_' . strtoupper($wpPageBase)));
if (defined('META_TAG_KEYWORDS_' . strtoupper($wpPageBase))) define('META_TAG_KEYWORDS', constant('META_TAG_KEYWORDS_' . strtoupper($wpPageBase)));
if (defined('META_TAG_DESCRIPTION_' . strtoupper($wpPageBase))) define('META_TAG_DESCRIPTION', constant('META_TAG_DESCRIPTION_' . strtoupper($wpPageBase)));
Next: Save the following code as " wp_meta_tags.php " and upload to includes/languages/english/YOURTEMPLATE/
PHP Code:
<?php
//Copy and paste this set of defines replacing /BLOGNAME/POST-NAME/ to fit your blog name and post name as you go.
define('META_TAG_TITLE_/BLOGNAME/POST-NAME/', 'Type Your Post Meta Title Here');
define('META_TAG_KEYWORDS_/BLOGNAME/POST-NAME/','Type Your Post Meta Keys Here');
define('META_TAG_DESCRIPTION_/BLOGNAME/POST-NAME/','Type Your Post Meta Descrip Here');
?>
Meta Defining works like this: The address of your post would be http://www.yoursite.com/blogname/post-name/
so the define would look like those above. Every letter must be captialized and the forward slash after your domain name and after the post address must be included (like the example).
This works for blog categories and pages too and the defines look like this:
/BLOGNAME/CATEGORY/CATEGORY-NAME
/BLOGNAME/PAGE/PAGE-NAME
The define examples above have some red text in them. That must be there for a category or a page.
Enjoy!
John
Bookmarks