I’d like to use the tags I have made for posts as their keywords in the Meta field. It makes good SEO, even if keyword tags are going out of style, it can’t hurt. This is what I have so far:
[php]
< ?php if (function_exists('UTW_ShowCurrentTagSet')) {
// Check if UTW exists, if so then do this: ?>
<meta name=”keywords” content=”< ?php echo UTW_ShowCurrentTagSet('tagsettextonly'); ?>“>
< ?php } ?>
[/php]
I place this little tidbit of code within the header PHP within the following if statement so that it only shows up on pages or posts:
[php]
< ?php if (is_single() or is_page()) { ?>
<link rel=”pingback” href=”< ?php bloginfo('pingback_url'); ?>” />
// Above code goes here to make a nested if (bad?)
< ?php } ?>
[/php]
Unfortunately it doesn’t work and it outputs no errors, but no keywords either.
[php]<meta name=”keywords” content=”">[/php]
What am I doing wrong / how can I fix it? Any help is appreciated, and as always I will post the answer for other to stumble upon.
01 Apr 06
5:04 pm
I was pondering about your problem after finding your idea of adding the tags as keywords pretty interesting.
I think it isn’t working is just simply because that the UTW tags only work if you placed it inside a loop. Do correct me if I am wrong.
01 Apr 06
9:39 pm
I came to the same conclusion and have been working on building a new loop for the keywords. I think this method could work. I will post any answer I find, thanks for your comments. Let me know if you come up with something.
11 Apr 06
2:21 pm
Seems I missed the boat on this one, but in case you haven’t figured this one out yet, I’d advise the following:
First, open up ultimate-tag-warrior-core.php and find the spot where all the predefined format types are down a ways. Somewhere in there amongst the others, insert:
$predefinedFormats["textcommalist"] = array (”default”=>”, %tagdisplay%”, “first”=>”%tagdisplay%”, “none”=>$notagtext );
then go back to your k2 theme dir and open up header.php to get back to that meta thing, hehe… Insert something to the effect of:
" />
Hrm, hopefully, the code tags are enabled in this commenting and it all gets through okay, otherwise just email me. Anyhow, I’d advise putting a very strict if structure to change what is displayed on which pages if anything at all and setting the No Tag text as well as the final else to a set of default keywords. Oh, and you should be able to use what you were trying to use on tag and tags pages, use is_tag() for checking those… though I’d append a limited number of related tags using the ShowRelatedTags functionality on tag pages or you’ll just end up with the one tag. I really hope this isn’t too confusing. Very scatter-brained and short on time at the moment.
You can also define the custom format(s) without touching ulitmate-tag-warrior-core.php but in the interest of keeping things clean and ordered (partictularly the header code) I’m much more in favor of adding the formats to the UTW code.
Recently I’ve been trying to figure out how to get apache/wordpress/utw (dunno who’s really responsible yet, but I think fiddling with my .htaccess a bit may do the trick and then making some changes in utw) to produce rel-tag compliant tag links to my own tag pages (not links to technorati). The stumbling block is how spaces are encoded in permalink urls. With tags I need the spaces to be encoded as + signs. Let me know if you have any ideas!
Cheers,
Ja
11 Apr 06
2:36 pm
Ja,
I have solved the keywords / UTW problem and I currently writing a small plugin for others to use. If interested, I’ll send it along for review / thoughts. Its quite simple, I just have to learn how to store info into the DB in order to properly release it. I don’t like having to edit php files to make things work.
I will think upon your permalinks issue, but it sound pretty tricky!
11 Apr 06
2:42 pm
Bah, no idea if this will work better but one more shot…
<meta name="keywords" content="<?php if ((is_single) && (function_exists(UTW_ShowTagsForCurrentPost))) { UTW_ShowTagsForCurrentPost("textcommalist"); } else { e("umm, standard keywords, i guess"); } ?>" />If that code segment doesn’t come out, the main idea is using this call below (after defining the custom format) in the header for single pages and sticking it in the metadata.
UTW_ShowTagsForCurrentPost(”textcommalist”);
Ja
11 Apr 06
5:09 pm
Ah, already working on a plugin, awesome! Yeah, do forward me a copy and I’ll poke around and see if there are any problems or obvious conflicts that I can spot. I’ll test it out on my in-house dev box. Maybe I can help with that last little bit though I’m sure you’ll have it nailed down pretty fast. I’m too lazy to make plugins of my own that I think of (I generally just hack stuff together for myself and think about cleaning it up for a plugin but then I’m onto a new thing already) so maybe I can help with others at least, hehe.
The permalink issue for tags, in theory, shouldn’t be that hard to correct if I can think of the right regex but for some reason I recall there being some issue with the “+” being used. I’m gonna give the .htaccess thing a try first, look at how bunnies’ plugin pulls it off if that doesn’t work, and then once I do get it writing the tag perms that way I’m likely going to have to change portions of the utw code so it will do the operations with encoding/decoding correctly for spaces and so it won’t conflict with the nifty combination operation which uses + in the uri to represent the operator. Hopefully, I can just make a rel-tag compliance mode addon for utw and possibly expand on some other aspects like more alternative uri operations/operators and scope limiting. Likely I’ll stop at the compliance mode part if I get that far because the other stuff has little practical value in comparison.
But drop me what you have for your plugin so far so I can take a break from the other stuff I’ve been doing for a bit and if I make any progress with the rel-tag stuff I’ll let you know… and of course please feel free to forward me any info you might stumble across on the subject!
Ja
17 Apr 06
5:58 pm
I made the plugin public: the answer is Tags in the Head
01 Jul 07
2:49 am
bondage bdsm sites models
http://www.amazingfreeponsite.com/models/teresa/