WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Aleph] List of interests (8 posts)

  1. Adam Klimowski
    Member
    Posted 5 years ago #

    Hi.

    I'd like to show list of all user's interests. How can I do that?

  2. scribu
    Member
    Posted 5 years ago #

    Try using custom fields.

  3. Adam Klimowski
    Member
    Posted 5 years ago #

    Thank you, but could you explain it as simple as possible? I'm beginner in this matter :)

  4. scribu
    Member
    Posted 5 years ago #

    See Using Custom Fields « WordPress Codex.

    If you want extra options in your user profile, you'll have to look for a plugin.

  5. Detective
    Member
    Posted 5 years ago #

    Adam, if you are using Aleph, to output the list of interests you have to use the following inside a posts loop (like in a blog post):

    <?php aleph_the_author_interests(); ?>

    And this in an user loop:

    <?php aleph_the_user_interests(); ?>

  6. Adam Klimowski
    Member
    Posted 5 years ago #

    Thanks, Detective. And when I want to display list of all users' interests? I think about list like in your Gaming Codes plugin, where I had list of people with Nintendo, with XBox, with PSN etc. ...

  7. Detective
    Member
    Posted 5 years ago #

    Currently there is no functionality to display all interests. Honestly, i didn't think about that, it's very interesting :)

    Please try the following:

    <?php
    $interests = get_terms('author-interests');
    if (!empty($interests)) {
    	$terms = array();
    	foreach ($interests as $interest)
    		$terms[] = aleph_get_interest_link($interest);
    	echo '<ul><li>' . implode('</li><li>', $terms) . '</li></ul>';
    }
    ?>

    Does this work?

  8. Adam Klimowski
    Member
    Posted 5 years ago #

    It works, you saved my life :) Thank you so much.

Topic Closed

This topic has been closed to new replies.

About this Topic