We are trying to rethink how a blog is laid out, by using Tags as primary headers for each post, instead of Categories.

In order to do this, we have to set a Tag for the post as Primary.

So, we are trying to read the Tags as they are input into the Post Tags widget in the Post Admin, by using Javascript to read the AJAX output printed to the page. We have accomplished that part of the equation.

What we haven't be able to do, is then use document.write after printing the tags using .ready to another widget we created, so that the end user may select one of the Tags as primary.

For some reason, it does not seem to like the document.write statement and we're not sure why.

Any suggestions?

  • Just to clarify, I want to get the tags BEFORE the user publishes the post. The tags don't exist in meta until publish, so we're trying to grab them from the AJAX display, so we can select one of them as primary, and have that become the "tag category" of the post. – Tony Zeoli Oct 25 '11 at 16:36
  • 1
    What do you mean by "set a Tag for the post as Primary"? What does that mean? Have you considered using hierarchical categories, or else using a custom taxonomy for your purposes? As-described, this sounds like trying to fit a square peg into a round hole. – Chip Bennett Oct 25 '11 at 16:42
  • Hey Chip, sorry...I'm not the most experienced user here, so I'll look at how to accept the answers. I thought voting was accepting. I'll have to check each post to see how to accept. I'm assuming it's the checkmark that you click on, is that right? – Tony Zeoli Oct 25 '11 at 16:56
  • 1
    I'm saying replace the concept of Primary Tag with Custom Taxonomy (that you could even call Primary Tag). That way, you can tag the post however you want, and then designate the "Primary Tag", via the custom taxonomy. Whatever you list in the custom taxonomy, you don't list as a Post Tag. – Chip Bennett Oct 25 '11 at 17:11
  • 1
    I'm going to compose my suggestion, and then move it into an answer, for further discussion. – Chip Bennett Oct 25 '11 at 17:35

Looks like someone on on of my listserves provided the answer:

He said to, "use innerHTML() within your ajax callback function. It looks like you're using jquery, so use the .load() function."

I checked on the jquery site and it said .innerHTML is .html in jQuery, so we'll go with that then and see if we can pull the AJAX data and print it somewhere else using that function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.