second level of categories (when offset=-1 doesn't work, like for "getcategorylink()"), pictures must be called exactly like category slug and placed to "catimg" folder. also i used "substr" for cut decription (314 symbols but you can change it). UPDATE: substr() replaced for mbsubstr cause of unicode unknown symbols in cyrilic. UPDATE2: replaced mbsubstr for function (http://snipplr.com/view/67430/cut-string-without-partial-words-unicode-version-with-mbsubstr/), now we have only full words, no partial.
- $query = "SELECT b.name, b.slug, description, b.term_id
- FROM $wpdb->term_taxonomy AS a
- LEFT JOIN $wpdb->terms AS b ON ( b.term_id = a.term_id)
- WHERE a.parent = $cat
- AND a.taxonomy = 'category'";
- $_ativis = $wpdb->get_results($query, OBJECT);
- <?php foreach ($_ativis as $_ativi) : ?>
- $link = get_category_link($_ativi->term_id);
- $excerpt = descr_excerpt($_ativi->description, 180);
- <?php endforeach; ?>
You need to login to post a comment.