Forums

Ajaxy Live Search
Category for Results (2 posts)

  1. angrystudentslep
    Member
    Posted 10 months ago #

    I am trying to display the category of results after the title. Currently it is displaying the date and author. I know how to modify this in the template files. This is what I concluded as the solution use {post_category} and insert the following code after
    $pst = get_post($result->ID);

    in sf.php:

    $post_category = get_the_category( $pst->ID, 'echo $category[0]->cat_name');
    $pst->post_category = $post_category;

    However, it is displaying [object Object]. What should I do?

    http://wordpress.org/extend/plugins/ajaxy-search-form/

  2. n-for-all
    Member
    Plugin Author

    Posted 8 months ago #

    $pst->post_category = $post_category[0]->cat_name;

    since get_the_category return an array of categories objects that the post belongs to

Reply

You must log in to post.

About this Plugin

About this Topic