WordPress.org

Ready to get started?Download WordPress

Forums

Request: Custom fields for categories (36 posts)

  1. jvolvovski
    Member
    Posted 4 years ago #

    ok, so it will only work on the archive/category page, outside the loop?

    i am trying to use the categories as the author name. i have the last name in the main category field, and the first name in the custom field.
    but i need to bring up both values in the index.php page for every single post.
    is there no way of doing that?

    does anyone have another solution? the reason why i have to separate the last name and first name is because i need it to appear as:
    smith, joe
    and
    joe smith

    thanks!

  2. sparro
    Member
    Posted 4 years ago #

    Unfortunately, I don't that the solution I posted will work for your instance. To link the call to the category (wp_list_categories or the_category) the Headspace meta code would have to be integrated also.

    Are you utilising your category descriptions at all? You could try that? (ie, you category name is "Smith" and the description is just "joe" then call using :

    <?php echo category_description( $category ); ?>

    Otherwise, author pages might work better for you?

  3. Ruriko
    Member
    Posted 4 years ago #

    What if I want to call a custom field value? for example I have a custom field called genre and the value is romance. I want to list all the categories that contain the word romance. how can I do this?

  4. sparro
    Member
    Posted 4 years ago #

    As far as I can tell, with the current WP, that's not going to be possible.

    Here's a few ways that I would do it:

    1. Why have a category called "Genre" ? Just have "Romance" as your category. Easy. You could set up a page called "Genre" if you wanted, then link posts there with a plugin like this: http://wordpress.org/extend/plugins/list-category-posts/

    2. Have categories called "Genre" and sub-categories "Romance", etc. Then call your sub-categories.

    3. Make "Genre" your category and tag posts with "Romance". Then call the tag.

  5. Ruriko
    Member
    Posted 4 years ago #

    None of those options do what I want to do. Here's a site with genres http://www.animelime.com/?genre=baseball

    It lists all the categories that contains the genre baseball

  6. sparro
    Member
    Posted 4 years ago #

    No, then this isn't going to help you. I'd email that site. I've never seen WP output something like ?genre=baseball before!

Topic Closed

This topic has been closed to new replies.

About this Topic