How to show posts of an columnized different categories on the same line or row?

One way to output the same query yet style it differently is to use current_post or in combination with rewind_posts, or using rewind_posts alone. So for example: Your initial query if ($my_query->have_posts()) :while ($my_query->have_posts()) : $my_query->the_post(); $counter_id = $my_query->current_post + 1; //this is the counter // then use a conditional to style each on based … Read more

Adding categories to all blogs at once

You could write a script for that, here is something I wrote in Perl lately: first the sql statements to check if the term already exist and if not insert it: the prepared statements: my $wts = $dbh->prepare( “SELECT term_id FROM $tb_wp_terms WHERE name = ?”) or die “Couldn’t prepare statement: ” . dbh->errstr; my … Read more

How to get Total Post In a Selceted category

I have one solution for you. This code will show and unordered list with the name of the category and the count of posts containded in it. <ul class=”myClass”> <?php $categories = get_categories(‘number=100’); foreach ($categories as $cat) { echo “<li>”. $cat->cat_name . ” Total posts: “. $cat->category_count .”</li>”; } ?> </ul> Retrieves the 100 first … Read more