Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator Gary Pendergast

    (@pento)

    There is a Category listing widget you can use to list the Job Manager categories.

    Alternatively, if you wish to add them to your theme, you can get a list of the categories with the following code:

    $categories = get_terms( 'jobman_category', 'hide_empty=0' );

    Thread Starter blackpantherk99yahoocom

    (@blackpantherk99yahoocom)

    Thanks for the reply pento! Although I tried it but it does not work. Can you please provide me with an example?

    Moderator Gary Pendergast

    (@pento)

    Here’s a brief example:

    $categories = get_terms( 'jobman_category', 'hide_empty=0' );
    foreach( $categories as $cat ) {
        echo "<a href='" . get_term_link( $cat->slug, 'jobman_category' ) . "'>$cat->name</a><br />";
    }
    Thread Starter blackpantherk99yahoocom

    (@blackpantherk99yahoocom)

    Thanks for the response.

    Thread Starter blackpantherk99yahoocom

    (@blackpantherk99yahoocom)

    Do you know where I may find a list of the Job Manager functions and properties?

    Moderator Gary Pendergast

    (@pento)

    Unfortunately, I don’t have a list of everything available – the code is a bit spaghetti-ish, so it isn’t really friendly for taking chunks and calling them from other code.

    I’m planning on adding a proper hook/filter-based API in version 1.0, due out later this year.

    In the mean time, I can help you out if there are specific things you want to do, though I can’t promise the functions will stay stable.

    Hi

    I’m using code similar to the code above, but I’m also wanting to display the number of jobs in each category. To do this, I’ve used $cat->count, which worked fine initially, but I noticed a problem.

    When an application is made for a job, the $cat->count is increased by one here. Is there a way you can think of that I could just show the number of jobs in the category? Here is the code in essence of what I have now…

    $categories = get_terms( 'jobman_category', 'hide_empty=0' );
    foreach( $categories as $cat ) {
    $count = ' (' . $cat->count . ')';
    echo "<li><a href='" . get_term_link( $cat->slug, 'jobman_category' ) . "'>$cat->name<span>$count</span></a></li>";
    }

    Thanks in advance

    See job-manager/widgets.php, line 201 onwards for an example of how to do this.

    Thanks a lot! That’s superb!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Job Manager] Listing categories in seperate page’ is closed to new replies.