Mystylook Theme Modification for Lyceum
From The Lyceum Wiki
- STEP 0
Find and open File: /mistylook-theme-path/functions.php
- STEP 1
Find line:
$numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish'");
Replace with 3 lines:
global $blog;
$tr_sql="SELECT COUNT(*) FROM ". $wpdb->posts . ", " . $wpdb->categories . ", " . $wpdb->post2cat . " WHERE post_status = 'publish' AND post2cat.post_id=posts.ID AND categories.cat_id = post2cat.category_id AND categories.blog= ".$blog;
$numposts = $wpdb->get_var($tr_sql);
- STEP 2
Find Line:
$numcmnts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
Replace with 2 lines:
$tr_sql="SELECT COUNT(*) FROM " . $wpdb->comments . ", ". $wpdb->posts . ", " . $wpdb->categories . ", " . $wpdb->post2cat . " WHERE comment_approved = '1' AND comments.comment_post_id=posts.ID AND post2cat.post_id=posts.ID AND categories.cat_id = post2cat.category_id AND categories.blog= ".$blog;
$numcmnts = $wpdb->get_var($tr_sql);
- STEP 3
Find 2 Lines:
global $wpdb;
$results = $wpdb->get_results("SELECT ID, post_title from $wpdb->posts WHERE post_type='page' AND post_parent=0 ORDER BY post_title");
Replace with 3 lines:
global $wpdb, $blog;
$tr_sql="SELECT ID, post_title from ". $wpdb->posts . ", " . $wpdb->categories . ", " . $wpdb->post2cat . " WHERE post_type='page' AND post_parent=0 AND post2cat.post_id=posts.ID AND categories.cat_id = post2cat.category_id AND categories.blog= ".$blog." ORDER BY post_title";
$results = $wpdb->get_results($tr_sql);
- STEP 4
Find 1 Line:
$asides_cats = $wpdb->get_results("SELECT * from $wpdb->categories WHERE category_count > 0");
Replace with a line:
$asides_cats = $wpdb->get_results("SELECT * from $wpdb->categories WHERE categories.blog= ".$blog." and category_count > 0");
