The MU forums have moved to WordPress.org

it wont simply display the category!! agh!! (2 posts)

  1. homienick
    Member
    Posted 16 years ago #

    my situation: I'm saving specific data into a specific table to be used as bookmarks for users. I'm trying to save the category the article is in, into a database. Every other one works fine, it saves the name of the article, the date, the url, but no matter what I do I can't save the category.

    I've tried: the_category and get_category_link
    WHY WONT THIS WORK? I'VE LITERALLY SPENT THE LAST 5 HOURS TRYING TO FIGURE THIS OUT, as a last resort, i'm asking for help.

    this is my form:

    <form action="wp_process.php" method="post">

    <input name="name" value="<?php the_title(); ?>" type="hidden" />

    <input name="category" value="<?php get_category_link(','); ?>" type="hidden" />

    <input name="posted_date" value="dealwithlater" type="hidden" />

    <input name="added_date" value="<?php echo date("F j, Y, g:i a"); ?>" type="hidden" />

    <input name="url" value="<?php the_permalink(); ?>" type="hidden" />

    <input value="add" type="submit" /> </form>

  2. InnateAdvertising
    Member
    Posted 15 years ago #

    I have had a similar problem with get_category_link. my example may help you:

    $this_category = "Latest News"; $this_category_id = get_cat_id($this_category);

    echo get_category_link($this_category_id);

    this gave me an error on upgrade and changed it to this:

    echo get_category_link("$this_category_id");

    all is working fine now. for some reason the "" helped and normally shouldnt.

    good luck!

About this Topic

  • Started 16 years ago by homienick
  • Latest reply from InnateAdvertising