function weaverii_per_post_style() { // Emit a <style> for this post global $weaverii_cur_post_id; $post_style = weaverii_get_per_post_value('ttw_per_post_style'); if (!empty($post_style)) { $rules = explode('}', trim($post_style)); $post_id = '#post-' . $weaverii_cur_post_id; echo "\n<style type=\"text/css\">\n"; foreach ($rules as $rule) { $rule = trim($rule); if (strlen($rule) > 1) { // must have some content to the rule! if ($rule[0] == '+') { echo substr($rule, 1) . "}\n"; } else { echo "{$post_id} {$rule}}\n"; } // add the post id to the front of each rule } } echo "</style>\n"; } }
function weaverii_post_count_class($hidecount = false) { global $weaverii_cur_post_count; global $weaverii_sticky; if ($weaverii_sticky) { // For page with posts - re-ordering sticky posts $postclass = weaverii_get_per_post_value('postclass') . ' sticky '; } else { $postclass = weaverii_get_per_post_value('postclass') . ' '; } if ($weaverii_cur_post_count == 0 || $hidecount) { return $postclass; } return $postclass . 'post-' . ($weaverii_cur_post_count % 2 ? 'odd' : 'even') . ' post-order-' . $weaverii_cur_post_count; }